Better 'Connection lost' notice that includes an indication of activity. fixes #24695.

git-svn-id: http://core.svn.wordpress.org/trunk@24743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin
2013-07-18 21:33:59 +00:00
parent e5df929fbf
commit 5bb2f20164
3 changed files with 19 additions and 2 deletions

View File

@@ -144,7 +144,11 @@ jQuery(document).ready( function($) {
// When connection is lost, keep user from submitting changes.
$(document).on('heartbeat-connection-lost.autosave', function( e, error ) {
if ( 'timeout' === error ) {
$('#lost-connection-notice').show();
var notice = $('#lost-connection-notice');
if ( ! wp.autosave.local.hasStorage ) {
notice.find('.hide-if-no-sessionstorage').hide();
}
notice.show();
autosave_disable_buttons();
}
}).on('heartbeat-connection-restored.autosave', function() {