Make WordPress Core

Changeset 41001


Ignore:
Timestamp:
07/05/2017 12:43:11 AM (8 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-nav-menus.js

    r40396 r41001  
    28532853
    28542854        _( data.nav_menu_updates ).each(function( update ) {
    2855             var oldCustomizeId, newCustomizeId, customizeId, oldSetting, newSetting, setting, settingValue, oldSection, newSection, wasSaved, widgetTemplate, navMenuCount;
     2855            var oldCustomizeId, newCustomizeId, customizeId, oldSetting, newSetting, setting, settingValue, oldSection, newSection, wasSaved, widgetTemplate, navMenuCount, shouldExpandNewSection;
    28562856            if ( 'inserted' === update.status ) {
    28572857                if ( ! update.previous_term_id ) {
     
    28852885                } );
    28862886
    2887                 if ( oldSection.expanded() ) {
     2887                shouldExpandNewSection = oldSection.expanded();
     2888                if ( shouldExpandNewSection ) {
    28882889                    oldSection.collapse();
    28892890                }
     
    29602961                } );
    29612962
    2962                 if ( oldSection.expanded.get() ) {
    2963                     // @todo This doesn't seem to be working.
     2963                if ( shouldExpandNewSection ) {
    29642964                    newSection.expand();
    29652965                }
Note: See TracChangeset for help on using the changeset viewer.