Changeset 32743
- Timestamp:
- 06/12/2015 10:27:51 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-controls.js
r32681 r32743 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 }, … … 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 } … … 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' ); … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.