summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-11-18 20:24:21 +0200
committerTor Lillqvist <tml@iki.fi>2020-11-20 18:21:28 +0200
commit82287c2ad26add97f6d401ca0af71cff2f6ecf1f (patch)
tree8f387c3e311160e64688204c88095397e11a56c0
parentAvoid on-screen keyboard never returning if dismissed explicitly (diff)
downloadonline-82287c2ad26add97f6d401ca0af71cff2f6ecf1f.tar.gz
online-82287c2ad26add97f6d401ca0af71cff2f6ecf1f.zip
Ignore pan gestures while selection handle is being dragged
Fixes https://github.com/CollaboraOnline/online/issues/398 . Signed-off-by: Tor Lillqvist <tml@collabora.com> Change-Id: I7ce26a45f2487ad18351ff382283b5c5167985c6
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js2
-rw-r--r--loleaflet/src/map/handler/Map.TouchGesture.js9
2 files changed, 11 insertions, 0 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 4ffad6aa95..5b5abb643e 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2837,6 +2837,7 @@ L.TileLayer = L.GridLayer.extend({
// Update dragged text selection.
_onSelectionHandleDrag: function (e) {
if (e.type === 'drag') {
+ window.IgnorePanning = true;
e.target.isDragged = true;
if (!e.originalEvent.pageX && !e.originalEvent.pageY) {
@@ -2876,6 +2877,7 @@ L.TileLayer = L.GridLayer.extend({
this._map.fire('handleautoscroll', {pos: containerPos, map: this._map});
}
if (e.type === 'dragend') {
+ window.IgnorePanning = undefined;
e.target.isDragged = false;
this._map.fire('scrollvelocity', {vx: 0, vy: 0});
}
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 02679be440..f4938a6d46 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -420,6 +420,9 @@ L.Map.TouchGesture = L.Handler.extend({
},
_onPanStart: function (e) {
+ if (window.IgnorePanning)
+ return;
+
L.Util.cancelAnimFrame(this.autoscrollAnimReq);
var point = e.pointers[0],
containerPoint = this._map.mouseEventToContainerPoint(point),
@@ -474,6 +477,9 @@ L.Map.TouchGesture = L.Handler.extend({
},
_onPan: function (e) {
+ if (window.IgnorePanning)
+ return;
+
var point = e.pointers[0],
containerPoint = this._map.mouseEventToContainerPoint(point),
layerPoint = this._map.containerPointToLayerPoint(containerPoint),
@@ -498,6 +504,9 @@ L.Map.TouchGesture = L.Handler.extend({
},
_onPanEnd: function (e) {
+ if (window.IgnorePanning)
+ return;
+
var point = e.pointers[0],
containerPoint = this._map.mouseEventToContainerPoint(point),
layerPoint = this._map.containerPointToLayerPoint(containerPoint),