Ticket #19994: 19994.diff
| File 19994.diff, 2.7 KB (added by , 13 years ago) |
|---|
-
wp-admin/js/common.js
1 1 var showNotice, adminMenu, columns, validateForm, screenMeta; 2 2 (function($){ 3 // Removed in 3.3. 4 // (perhaps) needed for back-compat 3 5 4 adminMenu = { 6 init : function() {}, 5 adminMenuWrap : null, 6 bodyMinWidth : null, 7 wpWrapOffset : null, 8 rejectedBrowser : null, 9 10 init : function() { 11 this.adminMenuWrap = $('#adminmenuwrap'); 12 this.bodyMinWidth = parseInt($(document.body).css('min-width')); 13 this.wpWrapOffset = $('#wpwrap').offset(); 14 15 // reject mobile devices, except iPads 16 if ( !$(document.body).hasClass('mobile') || /iPad/.test( navigator.userAgent ) ) 17 this.rejectedBrowser = false; 18 else 19 this.rejectedBrowser = true; 20 21 $(window).on('resize scoll', function() { adminMenu.position(); } ); 22 this.position(); 23 }, 24 25 position : function() { 26 if ( !this.rejectedBrowser ) { 27 // is the viewport higher than the admin menu (incl. toolbar height) && is the viewport wider than the min-width of the <body> 28 if ( $(window).height() > ( this.adminMenuWrap.height() + this.wpWrapOffset.top ) && $(window).width() > this.bodyMinWidth ) { 29 if ( !this.adminMenuWrap.hasClass('fixed') ) { 30 this.adminMenuWrap.addClass('fixed'); 31 } 32 } else if ( this.adminMenuWrap.hasClass('fixed') ) { 33 this.adminMenuWrap.removeClass('fixed'); 34 } 35 } 36 }, 37 38 // methods removed in 3.3, (perhaps) needed for back-compat 7 39 fold : function() {}, 8 40 restoreMenuState : function() {}, 9 41 toggle : function() {}, … … 168 200 $(e.target).parent().siblings('a').get(0).click(); 169 201 }); 170 202 203 // initialize admin menu 204 adminMenu.init(); 205 171 206 $('#collapse-menu').on('click.collapse-menu', function(e){ 172 207 var body = $(document.body); 173 208 … … 193 228 setUserSetting('mfold', 'f'); 194 229 } 195 230 } 231 232 // in case the menu expanded, reposition menu (if necessary) 233 adminMenu.position(); 196 234 }); 197 235 198 236 $('li.wp-has-submenu', menu).hoverIntent({ -
wp-admin/css/wp-admin-rtl.css
1625 1625 float: right; 1626 1626 } 1627 1627 1628 #adminmenuwrap.fixed { 1629 right: 0; 1630 } 1631 1628 1632 #adminmenu { 1629 1633 clear: right; 1630 1634 } -
wp-admin/css/wp-admin.css
1318 1318 float: left; 1319 1319 } 1320 1320 1321 #adminmenuwrap.fixed { 1322 position: fixed; 1323 top: 28px; 1324 left: 0; 1325 } 1326 1321 1327 #adminmenushadow { 1322 1328 position: absolute; 1323 1329 top: 0;