From 8e8efc1764651fd7716e02eef23955d99d26a32a Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Tue, 13 Oct 2020 07:06:15 +0530 Subject: [PATCH] leaflet: writer cursor does not appear after session idle problem: if shape was selected when document idle out, on reconnecting cursor will not appear directly, and after clicking somewhere cursor will not follow the view the reason behind the problem: if the shape was selected before idle out, on reconnecting _clip._selectionType is not cleared and is still "complex" this is what stops the view to follow cursor cursor is not visible because _isCursorVisible never reset Change-Id: I2c7170e9ee73a3c4c6bc36688c7ebc8b95bccb57 --- loleaflet/src/core/Socket.js | 1 + loleaflet/src/layer/tile/TileLayer.js | 4 ++++ loleaflet/src/map/Map.js | 2 ++ 3 files changed, 7 insertions(+) diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 65a363836..74ebb49a3 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -499,6 +499,7 @@ L.Socket = L.Class.extend({ { console.debug('idleness: reactivating'); map._documentIdle = false; + map._docLayer._setCursorVisible(); // force reinitialization of calcInputBar(formulabar) if (map.dialog._calcInputBar) map.dialog._calcInputBar.id = null; diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index dd0041ed0..dd5a82bdc 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -924,6 +924,10 @@ L.TileLayer = L.GridLayer.extend({ this._onUpdateCursor(); }, + _setCursorVisible: function() { + this._map._isCursorVisible = true; + }, + _onDownloadAsMsg: function (textMsg) { var command = this._map._socket.parseServerCmd(textMsg); var parser = document.createElement('a'); diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index 0487c290a..d91c9683a 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -310,6 +310,8 @@ L.Map = L.Evented.extend({ loadDocument: function(socket) { this._socket.connect(socket); + if (this._clip) + this._clip.clearSelection(); this.removeObjectFocusDarkOverlay(); },