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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 27 13:49:15 UTC 2018


 loleaflet/src/control/Control.MobileInput.js |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit a25aefaaeeb94e3a2867c4e38f584d550da743ba
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Sep 18 21:33:11 2018 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu Sep 27 09:48:48 2018 -0400

    loleaflet: mobile: add to layer if and only if the cursor marker is created
    
    Change-Id: Ida69eeceddcc0a3f223b724fb31d48f7722e21bf

diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 156cb4294..a5f15b52f 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -17,12 +17,16 @@ L.Control.MobileInput = L.Control.extend({
 	},
 
 	onGotFocus: function () {
-		this._map.addLayer(this._map._docLayer._cursorMarker);
+		if (this._map._docLayer._cursorMarker) {
+			this._map.addLayer(this._map._docLayer._cursorMarker);
+		}
 	},
 
 	onLostFocus: function () {
-		this._textArea.value = '';
-		this._map.removeLayer(this._map._docLayer._cursorMarker);
+		if (this._map._docLayer._cursorMarker) {
+			this._textArea.value = '';
+			this._map.removeLayer(this._map._docLayer._cursorMarker);
+		}
 	},
 
 	focus: function(focus) {


More information about the Libreoffice-commits mailing list