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

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

Built from https://develop.svn.wordpress.org/trunk@33754


git-svn-id: http://core.svn.wordpress.org/trunk@33722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2015-08-26 07:26:21 +00:00
parent a2d9547825
commit 10503cd3af
3 changed files with 18 additions and 4 deletions

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 );

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33753';
$wp_version = '4.4-alpha-33754';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.