loleaflet/src/map/Map.js |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit c57f5ab0b4d9e62b445472f7eb4b7e148c9e340e
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Wed Apr 26 13:15:03 2017 +0530

    loleaflet: Allow selecting annotations in readonly mode too
    
    Change-Id: I5c58baf95a1cbbb2ffbe756de30e596e2c35e6fb
    (cherry picked from commit 91421bae3d09ba15a71db3101d21b3b08b5de0d2)
    Reviewed-on: https://gerrit.libreoffice.org/36976
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 3a2ce54d..755d99d0 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -981,11 +981,16 @@ L.Map = L.Evented.extend({
                // For touch devices, to pop-up the keyboard, it is required to 
call
                // .focus() method on hidden input within actual 'click' event 
here
                // Calling from some other place with no real 'click' event 
doesn't work
-               if (type === 'click' && this._permission === 'edit') {
-                       this._textArea.blur();
-                       this._textArea.focus();
-                       if (this._docLayer && this._docLayer._annotations && 
this._docLayer._annotations.unselect)
+               if (type === 'click') {
+                       if (this._permission === 'edit') {
+                               this._textArea.blur();
+                               this._textArea.focus();
+                       }
+
+                       // unselect if anything is selected already
+                       if (this._docLayer && this._docLayer._annotations && 
this._docLayer._annotations.unselect) {
                                this._docLayer._annotations.unselect();
+                       }
                }
 
                // we need to keep track if we have entered/left the map
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to