Changeset 26743
- Timestamp:
- 12/06/2013 08:49:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/common.js
r26627 r26743 185 185 $('#adminmenu div.wp-submenu').css('margin-top', ''); 186 186 187 // WebKit excludes the width of the vertical scrollbar when applying the CSS "@media screen and (max-width: ...)" 188 // and matches $(window).width(). 189 // Firefox and IE > 8 include the scrollbar width, so after the jQuery normalization 190 // $(window).width() is 884px but window.innerWidth is 900px. 191 // (using window.innerWidth also excludes IE < 9) 192 respWidth = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $(window).width() : window.innerWidth; 187 if ( window.innerWidth ) { 188 // window.innerWidth is affected by zooming on phones 189 respWidth = Math.max( window.innerWidth, document.documentElement.clientWidth ); 190 } else { 191 // Exclude IE < 9, it doesn't support @media CSS rules 192 return; 193 } 193 194 194 195 if ( respWidth && respWidth < 900 ) { … … 604 605 605 606 trigger: function() { 606 var width = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $window.width() : window.innerWidth; 607 var width; 608 609 if ( window.innerWidth ) { 610 // window.innerWidth is affected by zooming on phones 611 width = Math.max( window.innerWidth, document.documentElement.clientWidth ); 612 } else { 613 // Exclude IE < 9, it doesn't support @media CSS rules 614 return; 615 } 607 616 608 617 if ( width <= 782 ) {
Note: See TracChangeset
for help on using the changeset viewer.