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

Henry Castro hcastro at collabora.com
Tue Aug 25 21:17:54 PDT 2015


 loleaflet/src/layer/tile/TileLayer.js |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit d60360dac3330f35e60d9fcf335e0a23c292d978
Author: Henry Castro <hcastro at collabora.com>
Date:   Wed Aug 26 00:16:48 2015 -0400

    loleaflet: clear cursor and selection when ...
    
    socket error.

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 0d91645..caa3070 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -113,6 +113,7 @@ L.TileLayer = L.GridLayer.extend({
 		this._map.on('zoomend', this._onUpdateCursor, this);
 		this._map.on('dragstart', this._onDragStart, this);
 		this._map.on('requestloksession', this._onRequestLOKSession, this);
+	        this._map.on('error', this._mapOnError, this);
 		this._startMarker.on('drag dragend', this._onSelectionHandleDrag, this);
 		this._endMarker.on('drag dragend', this._onSelectionHandleDrag, this);
 		this._textArea = this._map._textArea;
@@ -537,6 +538,12 @@ L.TileLayer = L.GridLayer.extend({
 		done(e, tile);
 	},
 
+       _mapOnError: function (e) {
+	   if (e.msg) {
+	       this._map.setPermission('view');
+	   }
+        },
+
 	_parseServerCmd: function (msg) {
 		var tokens = msg.split(/[ \n]+/);
 		var command = {};


More information about the Libreoffice-commits mailing list