Ticket #20614: 20614.7.diff
File 20614.7.diff, 4.4 KB (added by , 12 years ago) |
---|
-
wp-includes/js/admin-bar.js
30 30 el.addClass('hover'); 31 31 } 32 32 }); 33 } else {34 adminbar.find('li.menupop').hoverIntent({35 over: function(e){36 $(this).addClass('hover');37 },38 out: function(e){39 $(this).removeClass('hover');40 },41 timeout: 180,42 sensitivity: 7,43 interval: 10044 });45 33 } 46 34 35 adminbar.find('li.menupop').hoverIntent({ 36 over: function(e){ 37 $(this).addClass('hover'); 38 }, 39 out: function(e){ 40 $(this).removeClass('hover'); 41 }, 42 timeout: 180, 43 sensitivity: 7, 44 interval: 100 45 }); 46 47 47 $('#wp-admin-bar-get-shortlink').click(function(e){ 48 48 e.preventDefault(); 49 49 $(this).addClass('selected').children('.shortlink-input').blur(function(){ -
wp-admin/js/common.js
211 211 el.addClass('opensub'); 212 212 } 213 213 }); 214 } else { 215 menu.find('li.wp-has-submenu').hoverIntent({ 216 over: function(e){ 217 var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop, top = parseInt( m.css('top'), 10 ); 214 } 218 215 219 if ( isNaN(top) || top > -5 ) // meaning the submenu is visible 220 return; 216 menu.find('li.wp-has-submenu').hoverIntent({ 217 over: function(e){ 218 var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop, top = parseInt( m.css('top'), 10 ); 221 219 222 menutop = $(this).offset().top; 223 wintop = $(window).scrollTop(); 224 maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar 220 if ( isNaN(top) || top > -5 ) // meaning the submenu is visible 221 return; 225 222 226 b = menutop + m.height() + 1; // Bottom offset of the menu 227 h = $('#wpwrap').height(); // Height of the entire page 228 o = 60 + b - h; 229 f = $(window).height() + wintop - 15; // The fold 223 menutop = $(this).offset().top; 224 wintop = $(window).scrollTop(); 225 maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar 230 226 231 if ( f < (b - o) ) 232 o = b - f; 227 b = menutop + m.height() + 1; // Bottom offset of the menu 228 h = $('#wpwrap').height(); // Height of the entire page 229 o = 60 + b - h; 230 f = $(window).height() + wintop - 15; // The fold 233 231 234 if ( o > maxtop)235 o = maxtop;232 if ( f < (b - o) ) 233 o = b - f; 236 234 237 if ( o > 1 ) 238 m.css('margin-top', '-'+o+'px'); 239 else 240 m.css('margin-top', ''); 235 if ( o > maxtop ) 236 o = maxtop; 241 237 242 menu.find('li.menu-top').removeClass('opensub'); 243 $(this).addClass('opensub'); 244 }, 245 out: function(){ 246 $(this).removeClass('opensub').find('.wp-submenu').css('margin-top', ''); 247 }, 248 timeout: 200, 249 sensitivity: 7, 250 interval: 90 251 }); 238 if ( o > 1 ) 239 m.css('margin-top', '-'+o+'px'); 240 else 241 m.css('margin-top', ''); 252 242 253 menu.on('focus.adminmenu', '.wp-submenu a', function(e){ 254 $(e.target).closest('li.menu-top').addClass('opensub'); 255 }).on('blur.adminmenu', '.wp-submenu a', function(e){ 256 $(e.target).closest('li.menu-top').removeClass('opensub'); 257 }); 258 } 243 menu.find('li.menu-top').removeClass('opensub'); 244 $(this).addClass('opensub'); 245 }, 246 out: function(){ 247 $(this).removeClass('opensub').find('.wp-submenu').css('margin-top', ''); 248 }, 249 timeout: 200, 250 sensitivity: 7, 251 interval: 90 252 }); 259 253 254 menu.on('focus.adminmenu', '.wp-submenu a', function(e){ 255 $(e.target).closest('li.menu-top').addClass('opensub'); 256 }).on('blur.adminmenu', '.wp-submenu a', function(e){ 257 $(e.target).closest('li.menu-top').removeClass('opensub'); 258 }); 259 260 260 // Move .updated and .error alert boxes. Don't move boxes designed to be inline. 261 261 $('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2'); 262 262 $('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') );