diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5987bf4ed7..97ab2bdad2 100644
|
|
|
|
| 528 | 528 | * |
| 529 | 529 | * @since 4.1.0 |
| 530 | 530 | * |
| 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. |
| 535 | 536 | */ |
| 536 | 537 | onChangeActive: function( active, args ) { |
| 537 | 538 | var construct = this, |
| … |
… |
|
| 564 | 565 | } |
| 565 | 566 | } |
| 566 | 567 | |
| 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. |
| 569 | 570 | headContainer.toggle( active ); |
| 570 | 571 | if ( args.completeCallback ) { |
| 571 | 572 | args.completeCallback(); |
| 572 | 573 | } |
| 573 | 574 | } else if ( active ) { |
| 574 | | headContainer.stop( true, true ).slideDown( duration, args.completeCallback ); |
| | 575 | headContainer.slideDown( duration, args.completeCallback ); |
| 575 | 576 | } else { |
| 576 | 577 | if ( construct.expanded() ) { |
| 577 | 578 | construct.collapse({ |
| 578 | 579 | duration: duration, |
| 579 | 580 | completeCallback: function() { |
| 580 | | headContainer.stop( true, true ).slideUp( duration, args.completeCallback ); |
| | 581 | headContainer.slideUp( duration, args.completeCallback ); |
| 581 | 582 | } |
| 582 | 583 | }); |
| 583 | 584 | } else { |
| 584 | | headContainer.stop( true, true ).slideUp( duration, args.completeCallback ); |
| | 585 | headContainer.slideUp( duration, args.completeCallback ); |
| 585 | 586 | } |
| 586 | 587 | } |
| 587 | 588 | }, |