mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-04 18:01:42 +01:00
Fix submenu position and state on folded admin menu, props sambauers, fixes #9956
git-svn-id: http://svn.automattic.com/wordpress/trunk@11483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ad038538e3
commit
7e52231ce1
@ -26,9 +26,8 @@ adminMenu = {
|
||||
|
||||
if ( $('body').hasClass('folded') ) {
|
||||
this.fold();
|
||||
} else {
|
||||
this.restoreMenuState();
|
||||
}
|
||||
this.restoreMenuState();
|
||||
},
|
||||
|
||||
restoreMenuState : function() {
|
||||
@ -61,10 +60,16 @@ adminMenu = {
|
||||
$('body').addClass('folded');
|
||||
$('#adminmenu li.wp-has-submenu').hoverIntent({
|
||||
over: function(e){
|
||||
var m = $(this).find('.wp-submenu'), t = e.clientY, H = $(window).height(), h = m.height(), o;
|
||||
|
||||
if ( (t+h+10) > H ) {
|
||||
o = (t+h+10) - H;
|
||||
var m, b, h, o, f;
|
||||
m = $(this).find('.wp-submenu');
|
||||
b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu
|
||||
h = $('#wpwrap').height(); // Height of the entire page
|
||||
o = 60 + b - h;
|
||||
f = $(window).height() + $('body').scrollTop() - 15; // The fold
|
||||
if (f < (b - o)) {
|
||||
o = b - f;
|
||||
}
|
||||
if (o > 1) {
|
||||
m.css({'marginTop':'-'+o+'px'});
|
||||
} else if ( m.css('marginTop') ) {
|
||||
m.css({'marginTop':''});
|
||||
|
File diff suppressed because one or more lines are too long
@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
|
||||
|
||||
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090522' );
|
||||
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20090528' );
|
||||
$scripts->add_data( 'common', 'group', 1 );
|
||||
$scripts->localize( 'common', 'commonL10n', array(
|
||||
'warnDelete' => __("You are about to delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
|
||||
|
Loading…
Reference in New Issue
Block a user