Make WordPress Core

Changeset 41960


Ignore:
Timestamp:
10/21/2017 08:43:36 AM (6 years ago)
Author:
westonruter
Message:

Customize: Allow control subclasses to add to the deferred object before the base class initializes.

Update the CodeEditorControl's codemirror deferred to be set before calling the parent class's initialize method. Since the ready method may be called directly by initialize it may be too late to add a new Deferred to the control's deferred property after calling the base control class's initialize.

Amends [41958].
See #41897.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/customize-controls.js

    r41958 r41960  
    34203420            }
    34213421
    3422             control.deferred = {
     3422            control.deferred = _.extend( control.deferred || {}, {
    34233423                embedded: new $.Deferred()
    3424             };
     3424            } );
    34253425            control.section = new api.Value();
    34263426            control.priority = new api.Value();
     
    51285128        initialize: function( id, options ) {
    51295129            var control = this;
    5130             api.Control.prototype.initialize.call( this, id, options );
    5131             control.deferred.codemirror = $.Deferred();
     5130            control.deferred = _.extend( control.deferred || {}, {
     5131                codemirror: $.Deferred()
     5132            } );
     5133            api.Control.prototype.initialize.call( control, id, options );
    51325134        },
    51335135
Note: See TracChangeset for help on using the changeset viewer.