Customizer: Import missing `wp.customize.Control.prototype._toggleActive`.

Check also if `completeCallback` is set before calling it.

props westonruter.
see #30701.
Built from https://develop.svn.wordpress.org/trunk@30871


git-svn-id: http://core.svn.wordpress.org/trunk@30861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-12-15 19:54:21 +00:00
parent 62fc271e6a
commit d5914fc1c8
2 changed files with 15 additions and 4 deletions

View File

@ -252,7 +252,9 @@
if ( ! $.contains( document, this.container ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
this.container.toggle( active );
args.completeCallback();
if ( args.completeCallback ) {
args.completeCallback();
}
} else if ( active ) {
this.container.stop( true, true ).slideDown( duration, args.completeCallback );
} else {
@ -820,7 +822,7 @@
// Watch for changes to the section state
inject = function ( sectionId ) {
var parentContainer;
if ( ! sectionId ) { // @todo allow a control to be embeded without a section, for instance a control embedded in the frontend
if ( ! sectionId ) { // @todo allow a control to be embedded without a section, for instance a control embedded in the frontend
return;
}
// Wait for the section to be registered
@ -878,7 +880,9 @@
if ( ! $.contains( document, this.container ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
this.container.toggle( active );
args.completeCallback();
if ( args.completeCallback ) {
args.completeCallback();
}
} else if ( active ) {
this.container.slideDown( args.duration, args.completeCallback );
} else {
@ -913,6 +917,13 @@
*/
deactivate: Container.prototype.deactivate,
/**
* Re-use _toggleActive from Container class.
*
* @access private
*/
_toggleActive: Container.prototype._toggleActive,
dropdownInit: function() {
var control = this,
statuses = this.container.find('.dropdown-status'),

File diff suppressed because one or more lines are too long