Don't refresh the admin menu after page load, apply the user-state from PHP, fix behaviour after folding the menu, props nacin, props nuxwin, fixes #10646, fixes #17058

git-svn-id: https://develop.svn.wordpress.org/trunk@17623 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2011-04-07 18:45:22 +00:00
parent 587abe5d6b
commit 53d3dae91f
6 changed files with 22 additions and 22 deletions

View File

@@ -28,26 +28,15 @@ adminMenu = {
if ( $('body').hasClass('folded') )
this.fold();
this.restoreMenuState();
},
restoreMenuState : function() {
$('li.wp-has-submenu', '#adminmenu').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');
});
// (perhaps) needed for back-compat
},
toggle : function(el) {
el.slideToggle(150, function() {
var id = el.parent().toggleClass( 'wp-menu-open' ).attr('id');
var id = el.removeAttr('style').parent().toggleClass( 'wp-menu-open' ).attr('id');
if ( id ) {
$('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
if ( id == e.id ) {