Make WordPress Core

Ticket #31793: 31793.3.diff

File 31793.3.diff, 1.1 KB (added by ocean90, 10 years ago)
  • src/wp-admin/js/customize-controls.js

     
    19511951        api.ThemeControl = api.Control.extend({
    19521952
    19531953                touchDrag: false,
     1954                isRendered: false,
    19541955
    19551956                /**
    19561957                 * Defer rendering the theme control until the section is displayed.
     
    19611962                        var control = this,
    19621963                                renderContentArgs = arguments;
    19631964
    1964                         api.section( control.section(), function ( section ) {
     1965                        api.section( control.section(), function( section ) {
    19651966                                if ( section.expanded() ) {
    19661967                                        api.Control.prototype.renderContent.apply( control, renderContentArgs );
     1968                                        control.isRendered = true;
    19671969                                } else {
    1968                                         section.expanded.bind( function ( expanded ) {
    1969                                                 if ( expanded ) {
     1970                                        section.expanded.bind( function( expanded ) {
     1971                                                if ( expanded && ! control.isRendered ) {
    19701972                                                        api.Control.prototype.renderContent.apply( control, renderContentArgs );
     1973                                                        control.isRendered = true;
    19711974                                                }
    19721975                                        } );
    19731976                                }