Changeset 38648 for trunk/src/wp-admin/js/customize-nav-menus.js
- Timestamp:
- 09/23/2016 10:22:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-nav-menus.js
r38624 r38648 852 852 api.bind( 'pane-contents-reflowed', function() { 853 853 // Skip menus that have been removed. 854 if ( ! section.cont ainer.parent().length ) {854 if ( ! section.contentContainer.parent().length ) { 855 855 return; 856 856 } … … 970 970 971 971 if ( expanded ) { 972 wpNavMenu.menuList = section.cont ainer.find( '.accordion-section-content:first' );972 wpNavMenu.menuList = section.contentContainer; 973 973 wpNavMenu.targetList = wpNavMenu.menuList; 974 974 … … 1032 1032 var section = this, 1033 1033 button = section.container.find( '.add-menu-toggle' ), 1034 content = section.cont ainer.find( '.new-menu-section-content' ),1035 customizer = section. container.closest( '.wp-full-overlay-sidebar-content' );1034 content = section.contentContainer, 1035 customizer = section.headContainer.closest( '.wp-full-overlay-sidebar-content' ); 1036 1036 if ( expanded ) { 1037 1037 button.addClass( 'open' ); … … 1046 1046 content.find( '.menu-name-field' ).removeClass( 'invalid' ); 1047 1047 } 1048 }, 1049 1050 /** 1051 * Find the content element. 1052 * 1053 * @since 4.7.0 1054 * 1055 * @returns {jQuery} Content UL element. 1056 */ 1057 getContent: function() { 1058 return this.container.find( 'ul:first' ); 1048 1059 } 1049 1060 }); … … 2002 2013 ready: function() { 2003 2014 var control = this, 2015 section = api.section( control.section() ), 2004 2016 menuId = control.params.menu_id, 2005 2017 menu = control.setting(), … … 2018 2030 */ 2019 2031 control.active.validate = function() { 2020 var value , section = api.section( control.section() );2032 var value; 2021 2033 if ( section ) { 2022 2034 value = section.active(); … … 2027 2039 }; 2028 2040 2029 control.$controlSection = control.container.closest( '.control-section' );2041 control.$controlSection = section.headContainer; 2030 2042 control.$sectionContent = control.container.closest( '.accordion-section-content' ); 2031 2043 … … 2301 2313 } 2302 2314 2303 var section = control.container.closest( '.accordion-section'),2315 var section = api.section( control.section() ), 2304 2316 menuId = control.params.menu_id, 2305 controlTitle = section. find( '.accordion-section-title' ),2306 sectionTitle = section. find( '.customize-section-title h3' ),2307 location = section. find( '.menu-in-location' ),2317 controlTitle = section.headContainer.find( '.accordion-section-title' ), 2318 sectionTitle = section.contentContainer.find( '.customize-section-title h3' ), 2319 location = section.headContainer.find( '.menu-in-location' ), 2308 2320 action = sectionTitle.find( '.customize-action' ), 2309 2321 name = displayNavMenuName( menu.name ); … … 2329 2341 2330 2342 // Update the nav menu name in all location checkboxes. 2331 section. find( '.customize-control-checkbox input' ).each( function() {2343 section.contentContainer.find( '.customize-control-checkbox input' ).each( function() { 2332 2344 if ( $( this ).prop( 'checked' ) ) { 2333 2345 $( '.current-menu-location-name-' + $( this ).data( 'location-id' ) ).text( name ); … … 2643 2655 // Focus on the new menu section. 2644 2656 api.section( customizeId ).focus(); // @todo should we focus on the new menu's control and open the add-items panel? Thinking user flow... 2645 2646 // Fix an issue with extra space at top immediately after creating new menu.2647 $( '#menu-to-edit' ).css( 'margin-top', 0 );2648 2657 } 2649 2658 });
Note: See TracChangeset
for help on using the changeset viewer.