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

props westonruter.
fixes #31501.
Built from https://develop.svn.wordpress.org/trunk@31706


git-svn-id: http://core.svn.wordpress.org/trunk@31687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-03-10 22:45:27 +00:00
parent b96a624cb9
commit 9250d59e6a
5 changed files with 13 additions and 8 deletions

View File

@ -2444,10 +2444,7 @@
},
save: function() {
var self = this,
query = $.extend( this.query(), {
nonce: this.nonce.save
} ),
var self = this,
processing = api.state( 'processing' ),
submitWhenDoneProcessing,
submit;
@ -2455,7 +2452,11 @@
body.addClass( 'saving' );
submit = function () {
var request = wp.ajax.post( 'customize_save', query );
var request, query;
query = $.extend( self.query(), {
nonce: self.nonce.save
} );
request = wp.ajax.post( 'customize_save', query );
api.trigger( 'save', request );

File diff suppressed because one or more lines are too long

View File

@ -1028,7 +1028,11 @@
}
data += '&' + $widgetContent.find( '~ :input' ).serialize();
if ( this._previousUpdateRequest ) {
this._previousUpdateRequest.abort();
}
jqxhr = $.post( wp.ajax.settings.url, data );
this._previousUpdateRequest = jqxhr;
jqxhr.done( function( r ) {
var message, sanitizedForm, $sanitizedInputs, hasSameInputsInResponse,

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31705';
$wp_version = '4.2-alpha-31706';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.