diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js
index be3fba1..6260983 100644
a
|
b
|
|
1045 | 1045 | } |
1046 | 1046 | } ); |
1047 | 1047 | |
1048 | | if ( 'resolved' !== section.deferred.initSortables.state() ) { |
1049 | | wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above. |
1050 | | section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable. |
| 1048 | // Make sure Sortables is initialized after the section has been expanded to prevent `offset` issues. |
| 1049 | api.state( 'expandedSection' ).bind( $.proxy( function( newSection ) { |
| 1050 | var section = this; |
1051 | 1051 | |
1052 | | // @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated. |
1053 | | api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems(); |
1054 | | } |
| 1052 | if ( ! newSection || newSection.id !== section.id ) { |
| 1053 | return false; |
| 1054 | } |
| 1055 | if ( 'resolved' !== section.deferred.initSortables.state() ) { |
| 1056 | wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above. |
| 1057 | section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable. |
| 1058 | |
| 1059 | // @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated. |
| 1060 | api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems(); |
| 1061 | } |
| 1062 | }, section ) ); |
1055 | 1063 | } |
1056 | 1064 | api.Section.prototype.onChangeExpanded.call( section, expanded, args ); |
1057 | 1065 | } |