Make WordPress Core

Ticket #39430: 39430.2.diff

File 39430.2.diff, 2.0 KB (added by westonruter, 8 years ago)
  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index 5987bf4ed7..97ab2bdad2 100644
     
    528528                 *
    529529                 * @since 4.1.0
    530530                 *
    531                  * @param {Boolean} active
    532                  * @param {Object}  args
    533                  * @param {Object}  args.duration
    534                  * @param {Object}  args.completeCallback
     531                 * @param {boolean}  active - The active state to transiution to.
     532                 * @param {Object}   [args] - Args.
     533                 * @param {Object}   [args.duration] - The duration for the slideUp/slideDown animation.
     534                 * @param {boolean}  [args.unchanged] - Whether the state is already known to not be changed, and so short-circuit with calling completeCallback early.
     535                 * @param {Function} [args.completeCallback] - Function to call when the slideUp/slideDown has completed.
    535536                 */
    536537                onChangeActive: function( active, args ) {
    537538                        var construct = this,
     
    564565                                }
    565566                        }
    566567
    567                         if ( ! $.contains( document, headContainer ) ) {
    568                                 // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
     568                        if ( ! $.contains( document, headContainer.get( 0 ) ) ) {
     569                                // If the element is not in the DOM, then jQuery.fn.slideUp() does nothing. In this case, a hard toggle is required instead.
    569570                                headContainer.toggle( active );
    570571                                if ( args.completeCallback ) {
    571572                                        args.completeCallback();
    572573                                }
    573574                        } else if ( active ) {
    574                                 headContainer.stop( true, true ).slideDown( duration, args.completeCallback );
     575                                headContainer.slideDown( duration, args.completeCallback );
    575576                        } else {
    576577                                if ( construct.expanded() ) {
    577578                                        construct.collapse({
    578579                                                duration: duration,
    579580                                                completeCallback: function() {
    580                                                         headContainer.stop( true, true ).slideUp( duration, args.completeCallback );
     581                                                        headContainer.slideUp( duration, args.completeCallback );
    581582                                                }
    582583                                        });
    583584                                } else {
    584                                         headContainer.stop( true, true ).slideUp( duration, args.completeCallback );
     585                                        headContainer.slideUp( duration, args.completeCallback );
    585586                                }
    586587                        }
    587588                },