Default to having the menu open, not folded. Remember individual menu states when folding/unfolding.
git-svn-id: http://svn.automattic.com/wordpress/trunk@9381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ea002ede30
commit
a3b0a3190d
|
@ -17,19 +17,23 @@ adminMenu = {
|
|||
}
|
||||
});
|
||||
|
||||
if ( 'o' == getUserSetting( 'mfold' ) ) {
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = getUserSetting( 'm'+i );
|
||||
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');
|
||||
});
|
||||
if ( 'f' != getUserSetting( 'mfold' ) ) {
|
||||
this.restoreMenuState();
|
||||
} else {
|
||||
this.fold();
|
||||
}
|
||||
},
|
||||
|
||||
restoreMenuState : function() {
|
||||
$('#adminmenu li.wp-has-submenu').each(function(i, e) {
|
||||
var v = getUserSetting( 'm'+i );
|
||||
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');
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(ul, effect) {
|
||||
if ( !effect )
|
||||
effect = 'slideToggle';
|
||||
|
@ -50,9 +54,10 @@ adminMenu = {
|
|||
$('#wpbody-content').css('marginLeft', '180px');
|
||||
$('#adminmenu').removeClass('folded');
|
||||
$('#adminmenu li.wp-submenu-head').hide();
|
||||
$('#adminmenu a.wp-has-submenu, #adminmenu div.wp-menu-toggle').show();
|
||||
$('#adminmenu a.wp-has-submenu, #adminmenu .wp-menu-open .wp-submenu, #adminmenu div.wp-menu-toggle').show();
|
||||
$('#adminmenu li.wp-has-submenu').unbind().css('width', '');
|
||||
$('#adminmenu li.wp-has-submenu img.wp-menu-image').unbind().dblclick( function() { adminMenu.fold(); } );
|
||||
this.restoreMenuState();
|
||||
} else {
|
||||
$('#adminmenu').addClass('folded');
|
||||
$('#adminmenu a.wp-has-submenu, #adminmenu .wp-submenu, #adminmenu div.wp-menu-toggle').hide();
|
||||
|
|
Loading…
Reference in New Issue