Make WordPress Core

Changeset 31944


Ignore:
Timestamp:
03/31/2015 10:20:13 PM (11 years ago)
Author:
ocean90
Message:

Customizer: Defer rendering theme controls until the section is displayed.

see #31793.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r31920 r31944  
    18611861
    18621862                /**
     1863                 * Defer rendering the theme control until the section is displayed.
     1864                 *
     1865                 * @since 4.2.0
     1866                 */
     1867                renderContent: function () {
     1868                        var control = this,
     1869                                renderContentArgs = arguments;
     1870
     1871                        api.section( control.section(), function ( section ) {
     1872                                if ( section.expanded() ) {
     1873                                        api.Control.prototype.renderContent.apply( control, renderContentArgs );
     1874                                } else {
     1875                                        section.expanded.bind( function ( expanded ) {
     1876                                                if ( expanded ) {
     1877                                                        api.Control.prototype.renderContent.apply( control, renderContentArgs );
     1878                                                }
     1879                                        } );
     1880                                }
     1881                        } );
     1882                },
     1883
     1884                /**
    18631885                 * @since 4.2.0
    18641886                 */
Note: See TracChangeset for help on using the changeset viewer.