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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun May 8 16:14:34 UTC 2016


 loleaflet/src/layer/tile/TileLayer.js |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f9d7de86dbac428a846e85301e84135635835f59
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun May 8 11:42:02 2016 -0400

    loleaflet: don't show the start/end selection handles for viewers
    
    The handles imply (and indeed are designed for) changing the
    selection by dragging them around. Viewers can't change the
    selection, so no reason to give them the selection handles either.
    
    Change-Id: Ifa793ac982fd48be877e7ed7709f70890d8de194
    Reviewed-on: https://gerrit.libreoffice.org/24770
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index b5d0ecb..09c8c85 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -689,7 +689,7 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onTextSelectionEndMsg: function (textMsg) {
 		var strTwips = textMsg.match(/\d+/g);
-		if (strTwips != null) {
+		if (strTwips != null && this._map._editlock) {
 			var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1]));
 			var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3]));
 			var bottomRightTwips = topLeftTwips.add(offset);
@@ -704,7 +704,7 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onTextSelectionStartMsg: function (textMsg) {
 		var strTwips = textMsg.match(/\d+/g);
-		if (strTwips != null) {
+		if (strTwips != null && this._map._editlock) {
 			var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1]));
 			var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3]));
 			var bottomRightTwips = topLeftTwips.add(offset);


More information about the Libreoffice-commits mailing list