diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js index 1e5103a914..84f7faf739 100644 --- a/src/wp-admin/js/customize-controls.js +++ b/src/wp-admin/js/customize-controls.js @@ -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 );