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

New commits:
commit dd604fea10cb2dc126e0e8b6ebd7bf14babdaf7c
Author: Pranav Kant <[email protected]>
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 <[email protected]>
    Reviewed-by: Jan Holesovsky <[email protected]>
    Tested-by: Jan Holesovsky <[email protected]>

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'];
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to