For an intermittent connection, only disable save and publish buttons when the request times out. An error still means a we have a connection.

props azaozz.
see #24695.



git-svn-id: https://develop.svn.wordpress.org/trunk@24691 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-07-12 21:07:44 +00:00
parent 3275463453
commit cbc7814345
1 changed files with 6 additions and 4 deletions

View File

@ -142,12 +142,14 @@ jQuery(document).ready( function($) {
}
// When connection is lost, keep user from submitting changes.
$(document).on('heartbeat-connection-lost.autosave', function() {
autosave_disable_buttons();
$('#lost-connection-notice').show();
$(document).on('heartbeat-connection-lost.autosave', function( e, error ) {
if ( 'timeout' === error ) {
$('#lost-connection-notice').show();
autosave_disable_buttons();
}
}).on('heartbeat-connection-restored.autosave', function() {
autosave_enable_buttons();
$('#lost-connection-notice').hide();
autosave_enable_buttons();
});
});