Autosave: don't set "submit" buttons to disabled right before submitting the form. They are not sent with the form data, see #25272.

git-svn-id: https://develop.svn.wordpress.org/trunk@27015 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-01-22 21:25:05 +00:00
parent b663efb313
commit b29b5b21e4
1 changed files with 4 additions and 4 deletions

View File

@ -404,7 +404,7 @@ jQuery(document).ready( function($) {
$submitButtons = $submitpost.find( ':button, :submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
var $button = $(this);
if ( $button.prop('disabled') ) {
if ( $button.hasClass('button-disabled') ) {
event.preventDefault();
return;
}
@ -427,7 +427,7 @@ jQuery(document).ready( function($) {
releaseLock = false;
$(window).off( 'beforeunload.edit-post' );
$submitButtons.prop( 'disabled', true ).addClass( 'button-disabled' );
$submitButtons.addClass( 'button-disabled' );
if ( $button.attr('id') === 'publish' ) {
$submitpost.find('#major-publishing-actions .spinner').show();
@ -500,10 +500,10 @@ jQuery(document).ready( function($) {
}
$(document).on( 'autosave-disable-buttons.edit-post', function() {
$submitButtons.prop( 'disabled', true ).addClass( 'button-disabled' );
$submitButtons.addClass( 'button-disabled' );
}).on( 'autosave-enable-buttons.edit-post', function() {
if ( ! window.wp || ! window.wp.heartbeat || ! window.wp.heartbeat.hasConnectionError() ) {
$submitButtons.prop( 'disabled', false ).removeClass( 'button-disabled' );
$submitButtons.removeClass( 'button-disabled' );
}
});