From 91b0ce6f8dc16bac1d18123d23c600e733891c0f Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Tue, 21 Jan 2014 22:47:23 +0300 Subject: [PATCH] Subscribe to lostConnection event --- js/documents.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/documents.js b/js/documents.js index 15d0b246..a767a1fb 100644 --- a/js/documents.js +++ b/js/documents.js @@ -123,7 +123,7 @@ var documentsMain = { hideLostConnection : function() { $('#connection-lost,#warning-connection-lost').remove(); - $('#odf-toolbar').children(':not(#document-title)').show(); + $('#odf-toolbar').children(':not(#document-title,#saving-document)').show(); $('#memberList .memberListButton').css({opacity : 1}); } }, @@ -219,6 +219,13 @@ var documentsMain = { documentsMain.webodfEditorInstance.addEventListener(Editor.EVENT_BEFORESAVETOFILE, documentsMain.UI.showSave); documentsMain.webodfEditorInstance.addEventListener(Editor.EVENT_SAVEDTOFILE, documentsMain.UI.hideSave); documentsMain.webodfEditorInstance.addEventListener(Editor.EVENT_ERROR, documentsMain.onEditorShutdown); + documentsMain.webodfEditorInstance.addEventListener(Editor.EVENT_HASSESSIONHOSTCONNECTIONCHANGED, function(has) { + if (has){ + documentsMain.UI.hideLostConnection(); + } else { + documentsMain.UI.showLostConnection(); + } + }); // load the document and get called back when it's live documentsMain.webodfEditorInstance.openSession(documentsMain.esId, documentsMain.memberId, function() { documentsMain.webodfEditorInstance.startEditing();