mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
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:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user