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

see #31793.
Built from https://develop.svn.wordpress.org/trunk@31944


git-svn-id: http://core.svn.wordpress.org/trunk@31923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-03-31 22:21:25 +00:00
parent efb2740e88
commit 79a29b077e
3 changed files with 25 additions and 3 deletions

View File

@ -1859,6 +1859,28 @@
touchDrag: false,
/**
* Defer rendering the theme control until the section is displayed.
*
* @since 4.2.0
*/
renderContent: function () {
var control = this,
renderContentArgs = arguments;
api.section( control.section(), function ( section ) {
if ( section.expanded() ) {
api.Control.prototype.renderContent.apply( control, renderContentArgs );
} else {
section.expanded.bind( function ( expanded ) {
if ( expanded ) {
api.Control.prototype.renderContent.apply( control, renderContentArgs );
}
} );
}
} );
},
/**
* @since 4.2.0
*/

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta3-31943';
$wp_version = '4.2-beta3-31944';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.