summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-04-26 13:15:03 +0530
committerJan Holesovsky <kendy@collabora.com>2017-04-26 15:46:06 +0200
commitc57f5ab0b4d9e62b445472f7eb4b7e148c9e340e (patch)
tree990a27a3051875df9fdbca0556844c678db5c29d
parentffdf137a94b79fc4638ef4496d44e6c79a1aabf1 (diff)
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 <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--loleaflet/src/map/Map.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 3a2ce54d9..755d99d08 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