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

Cherry-picks [33754] onto 4.3 branch.
Props nikeo, westonruter.
Fixes #33428 for 4.3.
See also #33494.

Built from https://develop.svn.wordpress.org/branches/4.3@33941


git-svn-id: http://core.svn.wordpress.org/branches/4.3@33910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2015-09-07 06:14:22 +00:00
parent 23ef1979f6
commit 00342ece4a
2 changed files with 17 additions and 3 deletions

View File

@ -286,8 +286,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
@ -1499,6 +1506,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 );

File diff suppressed because one or more lines are too long