Changeset 39377 for branches/4.7
- Timestamp:
- 11/30/2016 05:44:08 PM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-admin/js/customize-nav-menus.js
r39345 r39377 1030 1030 1031 1031 onChangeExpanded: function( expanded, args ) { 1032 var section = this ;1032 var section = this, completeCallback; 1033 1033 1034 1034 if ( expanded ) { … … 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. 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 } 1048 // Make sure Sortables is initialized after the section has been expanded to prevent `offset` issues. 1049 if ( args.completeCallback ) { 1050 completeCallback = args.completeCallback; 1051 } 1052 args.completeCallback = function() { 1053 if ( 'resolved' !== section.deferred.initSortables.state() ) { 1054 wpNavMenu.initSortables(); // Depends on menu-to-edit ID being set above. 1055 section.deferred.initSortables.resolve( wpNavMenu.menuList ); // Now MenuControl can extend the sortable. 1056 1057 // @todo Note that wp.customize.reflowPaneContents() is debounced, so this immediate change will show a slight flicker while priorities get updated. 1058 api.control( 'nav_menu[' + String( section.params.menu_id ) + ']' ).reflowMenuItems(); 1059 } 1060 if ( _.isFunction( completeCallback ) ) { 1061 completeCallback(); 1062 } 1063 }; 1055 1064 } 1056 1065 api.Section.prototype.onChangeExpanded.call( section, expanded, args );
Note: See TracChangeset
for help on using the changeset viewer.