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:
@@ -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
|
||||
*/
|
||||
|
||||
4
wp-admin/js/customize-controls.min.js
vendored
4
wp-admin/js/customize-controls.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user