diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index 5d0b30b..1a088ca 100644
|
|
|
|
| 284 | 284 | * @param {Object} args.completeCallback |
| 285 | 285 | */ |
| 286 | 286 | onChangeActive: function ( active, args ) { |
| 287 | | var duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 ); |
| 288 | | if ( ! $.contains( document, this.container ) ) { |
| | 287 | var duration, construct = this; |
| | 288 | duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 ); |
| | 289 | if ( ! $.contains( document, construct.container[0] ) ) { |
| 289 | 290 | // jQuery.fn.slideUp is not hiding an element if it is not in the DOM |
| 290 | | this.container.toggle( active ); |
| | 291 | construct.container.toggle( active ); |
| 291 | 292 | if ( args.completeCallback ) { |
| 292 | 293 | args.completeCallback(); |
| 293 | 294 | } |
| 294 | 295 | } else if ( active ) { |
| 295 | | this.container.stop( true, true ).slideDown( duration, args.completeCallback ); |
| | 296 | construct.container.stop( true, true ).slideDown( duration, args.completeCallback ); |
| 296 | 297 | } else { |
| 297 | | this.container.stop( true, true ).slideUp( duration, args.completeCallback ); |
| | 298 | if ( construct.expanded() ) { |
| | 299 | construct.collapse({ |
| | 300 | duration: duration, |
| | 301 | completeCallback: function() { |
| | 302 | construct.container.stop( true, true ).slideUp( duration, args.completeCallback ); |
| | 303 | } |
| | 304 | }); |
| | 305 | } else { |
| | 306 | construct.container.stop( true, true ).slideUp( duration, args.completeCallback ); |
| | 307 | } |
| 298 | 308 | } |
| 299 | 309 | }, |
| 300 | 310 | |
| … |
… |
|
| 596 | 606 | position = content.offset().top; |
| 597 | 607 | scroll = container.scrollTop(); |
| 598 | 608 | content.css( 'margin-top', ( 45 - position - scroll ) ); |
| | 609 | if ( args.completeCallback ) { |
| | 610 | args.completeCallback(); |
| | 611 | } |
| 599 | 612 | }; |
| 600 | 613 | } |
| 601 | 614 | |
| … |
… |
|
| 616 | 629 | expand(); |
| 617 | 630 | } |
| 618 | 631 | |
| 619 | | } else if ( section.container.hasClass( 'open' ) ) { |
| | 632 | } else if ( ! expanded && section.container.hasClass( 'open' ) ) { |
| 620 | 633 | section.container.removeClass( 'open' ); |
| 621 | 634 | overlay.removeClass( 'section-open' ); |
| 622 | 635 | content.css( 'margin-top', 'inherit' ); |
| 623 | 636 | container.scrollTop( 0 ); |
| 624 | 637 | section.container.find( '.accordion-section-title' ).focus(); |
| | 638 | if ( args.completeCallback ) { |
| | 639 | args.completeCallback(); |
| | 640 | } |
| | 641 | } else { |
| | 642 | if ( args.completeCallback ) { |
| | 643 | args.completeCallback(); |
| | 644 | } |
| 625 | 645 | } |
| 626 | 646 | } |
| 627 | 647 | }); |