loleaflet/src/control/Permission.js |    1 +
 loleaflet/src/core/Socket.js        |    6 ++++++
 loleaflet/src/map/Map.js            |    2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit f84cad1e8d8ac18cc39e68a156ed06961875e349
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Tue Sep 20 15:15:56 2016 +0530

    loleaflet: Fix some cases of leaked connecting spinner
    
    Change-Id: If694e8f699a2a087dad1e36fc3b67960ac294560

diff --git a/loleaflet/src/control/Permission.js 
b/loleaflet/src/control/Permission.js
index 5be2554..8df2297 100644
--- a/loleaflet/src/control/Permission.js
+++ b/loleaflet/src/control/Permission.js
@@ -3,6 +3,7 @@
  */
 L.Map.include({
        setPermission: function (perm) {
+               this._oldPermission = this._permission;
                this._permission = perm;
                if (perm === 'edit') {
                        this._socket.sendMessage('requestloksession');
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 29e7059..58e1de8 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -74,9 +74,11 @@ L.Socket = L.Class.extend({
                // TODO: Move the version number somewhere sensible.
                this._doSend('loolclient ' + this.ProtocolVersionNumber);
 
+               var reconnecting = false;
                var msg = 'load url=' + this._map.options.doc;
                if (this._map._docLayer) {
                        // we are reconnecting after a lost connection
+                       reconnecting = true;
                        msg += ' part=' + this._map.getCurrentPartNumber();
                        this._map.fire('statusindicator', {statusType : 
'reconnected'});
                }
@@ -100,6 +102,10 @@ L.Socket = L.Class.extend({
                }
                this._msgQueue = [];
 
+               if (reconnecting) {
+                       this._map.setPermission(this._map._oldPermission);
+               }
+
                this._map._activate();
        },
 
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index e2204b4..7baeaae 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -835,7 +835,7 @@ L.Map = L.Evented.extend({
                else if (e.statusType === 'setvalue') {
                        this._progressBar.setValue(e.value);
                }
-               else if (e.statusType === 'finish' || e.statusType === 
'loleafletloaded') {
+               else if (e.statusType === 'finish' || e.statusType === 
'loleafletloaded' || e.statusType === 'reconnected') {
                        this.hideBusy();
                }
        },
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to