Make WordPress Core

Changeset 30916


Ignore:
Timestamp:
12/16/2014 07:35:32 PM (12 years ago)
Author:
johnbillion
Message:

Customizer: Import missing wp.customize.Control.prototype._toggleActive.

Check also if completeCallback is set before calling it.

Merges [30871] to the 4.1 branch.

Props westonruter.
See #30701.

Location:
branches/4.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.1

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

    r30915 r30916  
    253253                                // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
    254254                                this.container.toggle( active );
    255                                 args.completeCallback();
     255                                if ( args.completeCallback ) {
     256                                        args.completeCallback();
     257                                }
    256258                        } else if ( active ) {
    257259                                this.container.stop( true, true ).slideDown( duration, args.completeCallback );
     
    821823                        inject = function ( sectionId ) {
    822824                                var parentContainer;
    823                                 if ( ! sectionId ) { // @todo allow a control to be embeded without a section, for instance a control embedded in the frontend
     825                                if ( ! sectionId ) { // @todo allow a control to be embedded without a section, for instance a control embedded in the frontend
    824826                                        return;
    825827                                }
     
    879881                                // jQuery.fn.slideUp is not hiding an element if it is not in the DOM
    880882                                this.container.toggle( active );
    881                                 args.completeCallback();
     883                                if ( args.completeCallback ) {
     884                                        args.completeCallback();
     885                                }
    882886                        } else if ( active ) {
    883887                                this.container.slideDown( args.duration, args.completeCallback );
     
    913917                 */
    914918                deactivate: Container.prototype.deactivate,
     919
     920                /**
     921                 * Re-use _toggleActive from Container class.
     922                 *
     923                 * @access private
     924                 */
     925                _toggleActive: Container.prototype._toggleActive,
    915926
    916927                dropdownInit: function() {
Note: See TracChangeset for help on using the changeset viewer.