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

New commits:
commit a25aefaaeeb94e3a2867c4e38f584d550da743ba
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Sep 18 21:33:11 2018 -0400
Commit:     Henry Castro <hcas...@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) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to