Fix admin menu save state. props greuben, fixes #15767, see #15615.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-12-11 08:41:48 +00:00
parent 566f62b824
commit e384bd8c2f
3 changed files with 14 additions and 15 deletions

View File

@ -45,19 +45,18 @@ adminMenu = {
}); });
}, },
toggle : function(el) { toggle : function(el) {
var id = el.slideToggle(150, function() { el.slideToggle(150, function() {
el.parent().toggleClass( 'wp-menu-open' ); var id = el.parent().toggleClass( 'wp-menu-open' ).attr('id');
}).attr('id'); if ( id ) {
$('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
if ( id ) { if ( id == e.id ) {
$('li.wp-has-submenu', '#adminmenu').each(function(i, e) { var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
if ( id == e.id ) { setUserSetting( 'm'+i, v );
var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c'; }
setUserSetting( 'm'+i, v ); });
} }
}); });
}
return false; return false;
}, },

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' ); $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20101208' ); $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20101211' );
$scripts->add_data( 'common', 'group', 1 ); $scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array( $scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),