From cbc78143450bfa652760ada36de110143d41262f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 12 Jul 2013 21:07:44 +0000 Subject: [PATCH] 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 --- wp-includes/js/autosave.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index 9be07d8dee..c4157d552e 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -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(); }); });