Customize: Fix logic to re-expand a newly inserted nav menu section after placeholder section is replaced.
Fixes todo from Menu Customizer feature plugin: https://github.com/voldemortensen/menu-customizer/commit/0f4ea4e#diff-daa55fade2253f26ccbe02f71058841cR2330 Amends [32806]. Props greuben. See #32576. Fixes #40997. Built from https://develop.svn.wordpress.org/trunk@41001 git-svn-id: http://core.svn.wordpress.org/trunk@40851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
046fb8a987
commit
7b28ff2f2a
|
@ -2852,7 +2852,7 @@
|
|||
var insertedMenuIdMapping = {}, insertedMenuItemIdMapping = {};
|
||||
|
||||
_( data.nav_menu_updates ).each(function( update ) {
|
||||
var oldCustomizeId, newCustomizeId, customizeId, oldSetting, newSetting, setting, settingValue, oldSection, newSection, wasSaved, widgetTemplate, navMenuCount;
|
||||
var oldCustomizeId, newCustomizeId, customizeId, oldSetting, newSetting, setting, settingValue, oldSection, newSection, wasSaved, widgetTemplate, navMenuCount, shouldExpandNewSection;
|
||||
if ( 'inserted' === update.status ) {
|
||||
if ( ! update.previous_term_id ) {
|
||||
throw new Error( 'Expected previous_term_id' );
|
||||
|
@ -2884,7 +2884,8 @@
|
|||
previewer: api.previewer
|
||||
} );
|
||||
|
||||
if ( oldSection.expanded() ) {
|
||||
shouldExpandNewSection = oldSection.expanded();
|
||||
if ( shouldExpandNewSection ) {
|
||||
oldSection.collapse();
|
||||
}
|
||||
|
||||
|
@ -2959,8 +2960,7 @@
|
|||
}
|
||||
} );
|
||||
|
||||
if ( oldSection.expanded.get() ) {
|
||||
// @todo This doesn't seem to be working.
|
||||
if ( shouldExpandNewSection ) {
|
||||
newSection.expand();
|
||||
}
|
||||
} else if ( 'updated' === update.status ) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-alpha-41000';
|
||||
$wp_version = '4.9-alpha-41001';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue