Make WordPress Core

Ticket #40997: fix.2.patch

File fix.2.patch, 1.3 KB (added by westonruter, 8 years ago)
  • src/wp-admin/js/customize-nav-menus.js

    diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js
    index 9cd39c96f6..893dd42232 100644
    a b  
    28522852                var insertedMenuIdMapping = {}, insertedMenuItemIdMapping = {};
    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 ) {
    28582858                                        throw new Error( 'Expected previous_term_id' );
     
    28842884                                        previewer: api.previewer
    28852885                                } );
    28862886
    2887                                 if ( oldSection.expanded() ) {
     2887                                shouldExpandNewSection = oldSection.expanded();
     2888                                if ( shouldExpandNewSection ) {
    28882889                                        oldSection.collapse();
    28892890                                }
    28902891
     
    29592960                                        }
    29602961                                } );
    29612962
    2962                                 if ( oldSection.expanded.get() ) {
    2963                                         // @todo This doesn't seem to be working.
     2963                                if ( shouldExpandNewSection ) {
    29642964                                        newSection.expand();
    29652965                                }
    29662966                        } else if ( 'updated' === update.status ) {