mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
Avoid rare autosave collision when trying to publish the post immediately after it was autosaved, fixes #6785
git-svn-id: http://svn.automattic.com/wordpress/trunk@11927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3d8c41869d
commit
0bef493958
@ -183,13 +183,15 @@ function autosave_loading() {
|
||||
}
|
||||
|
||||
function autosave_enable_buttons() {
|
||||
jQuery(':button, :submit', '#submitpost').removeAttr('disabled');
|
||||
jQuery('#ajax-loading').css('visibility', 'hidden');
|
||||
// delay that a bit to avoid some rare collisions while the DOM is being updated.
|
||||
setTimeout(function(){
|
||||
jQuery(':button, :submit', '#submitpost').removeAttr('disabled');
|
||||
jQuery('#ajax-loading').css('visibility', 'hidden');
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function autosave_disable_buttons() {
|
||||
jQuery(':button, :submit', '#submitpost').attr('disabled', 'disabled');
|
||||
//jQuery('#ajax-loading').css('visibility', 'visible');
|
||||
// Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
|
||||
setTimeout(autosave_enable_buttons, 5000);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -98,7 +98,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};'
|
||||
) );
|
||||
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090825' );
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090913' );
|
||||
$scripts->add_data( 'autosave', 'group', 1 );
|
||||
|
||||
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20090504' );
|
||||
|
Loading…
Reference in New Issue
Block a user