Ticket #28580: 28580.2.diff
File 28580.2.diff, 1.8 KB (added by , 10 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
163 163 container.params = {}; 164 164 $.extend( container, options || {} ); 165 165 container.container = $( container.params.content ); 166 container.contentEmbedded = false; 166 167 167 168 container.deferred = { 168 169 embedded: new $.Deferred() … … 499 500 500 501 if ( expanded ) { 501 502 503 if ( ! section.contentEmbedded ) { 504 _.each( api.section( section.id ).controls(), function( control ) { 505 control.embed(); 506 } ); 507 section.contentEmbedded = true; 508 } 509 502 510 if ( args.unchanged ) { 503 511 expand = args.completeCallback; 504 512 } else { … … 696 704 content = section.find( '.control-panel-content' ); 697 705 698 706 if ( expanded ) { 707 if ( ! panel.contentEmbedded ) { 708 _.each( api.section( panel.id ).controls(), function( control ) { 709 control.embed(); 710 } ); 711 panel.contentEmbedded = true; 712 } 699 713 700 714 // Collapse any sibling sections/panels 701 715 api.section.each( function ( otherSection ) { … … 1163 1177 } 1164 1178 1165 1179 control.setting = control.settings['default'] || null; 1166 1167 control.embed();1168 1180 }) ); 1169 1181 1170 1182 control.deferred.embedded.done( function () { … … 2617 2629 rootNodes.push( section ); 2618 2630 } 2619 2631 appendContainer = section.container.find( 'ul:first' ); 2620 if ( ! api.utils.areElementListsEqual( controlContainers, appendContainer.children( '[id]' ) ) ) { 2632 if ( ! api.utils.areElementListsEqual( controlContainers, appendContainer.children( '[id]' ) ) 2633 && section.contentEmbedded ) { 2621 2634 _( controls ).each( function ( control ) { 2622 2635 appendContainer.append( control.container ); 2623 2636 } );