WordPress.org

Make WordPress Core

Changeset 31706


Ignore:
Timestamp:
03/10/2015 10:44:25 PM (5 years ago)
Author:
ocean90
Message:

Customizer: Prevent a race condition when attempting to publish too soon after updating widget form fields with multiple edits.

props westonruter.
fixes #31501.

Location:
trunk/src/wp-admin/js
Files:
2 edited

Legend:

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

    r31705 r31706  
    24452445
    24462446            save: function() {
    2447                 var self  = this,
    2448                     query = $.extend( this.query(), {
    2449                         nonce:  this.nonce.save
    2450                     } ),
     2447                var self = this,
    24512448                    processing = api.state( 'processing' ),
    24522449                    submitWhenDoneProcessing,
     
    24562453
    24572454                submit = function () {
    2458                     var request = wp.ajax.post( 'customize_save', query );
     2455                    var request, query;
     2456                    query = $.extend( self.query(), {
     2457                        nonce:  self.nonce.save
     2458                    } );
     2459                    request = wp.ajax.post( 'customize_save', query );
    24592460
    24602461                    api.trigger( 'save', request );
  • trunk/src/wp-admin/js/customize-widgets.js

    r31594 r31706  
    10291029            data += '&' + $widgetContent.find( '~ :input' ).serialize();
    10301030
     1031            if ( this._previousUpdateRequest ) {
     1032                this._previousUpdateRequest.abort();
     1033            }
    10311034            jqxhr = $.post( wp.ajax.settings.url, data );
     1035            this._previousUpdateRequest = jqxhr;
    10321036
    10331037            jqxhr.done( function( r ) {
Note: See TracChangeset for help on using the changeset viewer.