[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd' - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Mon Aug 14 16:11:24 UTC 2017


 loleaflet/src/map/handler/Map.WOPI.js |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit dd604fea10cb2dc126e0e8b6ebd7bf14babdaf7c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Mon Aug 14 17:42:07 2017 +0530

    loleaflet: Handle Close_Session even if document is not loaded
    
    Now the Close_Session Post message command can be used to close the
    documents while it is loading.
    
    Change-Id: If60391834fedc90b3dcb63848aa72503eb43888d
    (cherry picked from commit 1a9d5c2cccaec2c845af012b2dea3dab89b5241e)
    Reviewed-on: https://gerrit.libreoffice.org/41139
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 70efcea4..3b3f31e2 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -109,6 +109,12 @@ L.Map.WOPI = L.Handler.extend({
 			return;
 		}
 
+		// allow closing documents before they are completely loaded
+		if (msg.MessageId === 'Close_Session') {
+			this._map._socket.sendMessage('closedocument');
+			return;
+		}
+
 		// For all other messages, warn if trying to interact before we are completely loaded
 		if (!this._appLoaded) {
 			console.error('LibreOffice Online not loaded yet. Listen for App_LoadingStatus (Document_Loaded) event before using PostMessage API. Ignoring post message \'' + msg.MessageId + '\'.');
@@ -170,9 +176,6 @@ L.Map.WOPI = L.Handler.extend({
 
 			this._postMessage({msgId: 'Get_Views_Resp', args: getMembersRespVal});
 		}
-		else if (msg.MessageId === 'Close_Session') {
-			this._map._socket.sendMessage('closedocument');
-		}
 		else if (msg.MessageId === 'Action_Save') {
 			var dontTerminateEdit = msg.Values && msg.Values['DontTerminateEdit'];
 			var dontSaveIfUnmodified = msg.Values && msg.Values['DontSaveIfUnmodified'];


More information about the Libreoffice-commits mailing list