Simple "sticky" menu, remembers the open parents and the current parent is always open
git-svn-id: http://svn.automattic.com/wordpress/trunk@8953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eb3e916086
commit
1d6c32e2a8
|
@ -54,12 +54,28 @@ jQuery( function($) {
|
|||
effect = 'slideToggle';
|
||||
}
|
||||
ul[effect]().parent().toggleClass( 'wp-menu-open' );
|
||||
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
|
||||
|
||||
setUserSetting( 'm'+i, v );
|
||||
});
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
jQuery('#adminmenu li.wp-has-submenu > a').click( function() { return menuToggle( jQuery(this).siblings('ul') ); } );
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = getUserSetting( 'm'+i );
|
||||
|
||||
jQuery('#dashmenu li.wp-has-submenu').bind( 'mouseenter mouseleave', function() { return menuToggle( jQuery(this).children('ul'), 'toggle' ); } );
|
||||
if ( $(e).hasClass('wp-has-current-submenu') ) return true; // leave the current parent open
|
||||
|
||||
if ( 'o' == v ) $(e).addClass('wp-menu-open');
|
||||
else if ( 'c' == v ) $(e).removeClass('wp-menu-open');
|
||||
});
|
||||
|
||||
$('#adminmenu li.wp-has-submenu > a').click( function() { return menuToggle( $(this).siblings('ul') ); } );
|
||||
|
||||
$('#dashmenu li.wp-has-submenu').bind( 'mouseenter mouseleave', function() { return menuToggle( $(this).children('ul'), 'toggle' ); } );
|
||||
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in New Issue