Make WordPress Core

Ticket #30251: 30251.diff

File 30251.diff, 2.4 KB (added by westonruter, 10 years ago)

https://github.com/xwp/wordpress-develop/pull/53

  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index 66d63bd..43084a5 100644
     
    131131         * @augments wp.customize.Class
    132132         */
    133133        Container = api.Class.extend({
    134                 defaultActiveArguments: { duration: 'fast' },
    135                 defaultExpandedArguments: { duration: 'fast' },
     134                defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
     135                defaultExpandedArguments: { duration: 'fast', completeCallback: $.noop },
    136136
    137137                initialize: function ( id, options ) {
    138138                        var container = this;
     
    217217                 */
    218218                onChangeActive: function ( active, args ) {
    219219                        var duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
    220                         if ( active ) {
     220                        if ( ! $.contains( document, this.container ) ) {
     221                                // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
     222                                this.container.toggle( active );
     223                                args.completeCallback();
     224                        } else if ( active ) {
    221225                                this.container.stop( true, true ).slideDown( duration, args.completeCallback );
    222226                        } else {
    223227                                this.container.stop( true, true ).slideUp( duration, args.completeCallback );
     
    640644         * @augments wp.customize.Class
    641645         */
    642646        api.Control = api.Class.extend({
    643                 defaultActiveArguments: { duration: 'fast' },
     647                defaultActiveArguments: { duration: 'fast', completeCallback: $.noop },
    644648
    645649                initialize: function( id, options ) {
    646650                        var control = this,
     
    781785                 * @param {Object} args  merged on top of this.defaultActiveArguments
    782786                 */
    783787                onChangeActive: function ( active, args ) {
    784                         if ( active ) {
     788                        if ( ! $.contains( document, this.container ) ) {
     789                                // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
     790                                this.container.toggle( active );
     791                                args.completeCallback();
     792                        } else if ( active ) {
    785793                                this.container.slideDown( args.duration, args.completeCallback );
    786794                        } else {
    787795                                this.container.slideUp( args.duration, args.completeCallback );
  • src/wp-admin/js/customize-widgets.js

    diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
    index 3338f7b..eac16a5 100644
     
    405405         */
    406406        api.Widgets.WidgetControl = api.Control.extend({
    407407                defaultExpandedArguments: {
    408                         duration: 'fast'
     408                        duration: 'fast',
     409                        completeCallback: $.noop
    409410                },
    410411
    411412                initialize: function ( id, options ) {