[Libreoffice-commits] online.git: loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Tue Sep 20 09:49:05 UTC 2016


 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 <pranavk at 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();
 		}
 	},


More information about the Libreoffice-commits mailing list