Customizer: Ensure persistence of unchanged active state for controls, sections, and panels.

Props nikeo, westonruter.
Fixes #33428 for trunk.
See also #33494.


git-svn-id: https://develop.svn.wordpress.org/trunk@33754 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2015-08-26 07:25:20 +00:00
parent e32f3cd3e1
commit 9c4f261598

View File

@ -284,8 +284,15 @@
* @param {Object} args.duration
* @param {Object} args.completeCallback
*/
onChangeActive: function ( active, args ) {
onChangeActive: function( active, args ) {
var duration, construct = this;
if ( args.unchanged ) {
if ( args.completeCallback ) {
args.completeCallback();
}
return;
}
duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
if ( ! $.contains( document, construct.container[0] ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
@ -1497,6 +1504,13 @@
* @param {Callback} args.completeCallback
*/
onChangeActive: function ( active, args ) {
if ( args.unchanged ) {
if ( args.completeCallback ) {
args.completeCallback();
}
return;
}
if ( ! $.contains( document, this.container ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
this.container.toggle( active );