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: http://core.svn.wordpress.org/trunk@24691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-12 21:07:44 +00:00
parent 36aec42cad
commit a9a0d3b27d

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();
});
});