[Libreoffice-commits] online.git: loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 20 15:17:18 UTC 2019
loleaflet/src/map/handler/Map.TouchGesture.js | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 38bce3d6f1e9c54825bbf55a5c2f2659c96d818f
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Jul 10 11:57:22 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Tue Aug 20 17:17:00 2019 +0200
loeaflet: mobile: avoid long press event when a graphic is panning, part2
Change-Id: I9ecc20030f8db2ec85b8dbfca91a390b5d32c841
Reviewed-on: https://gerrit.libreoffice.org/77842
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 331adff01..01b564ddc 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -137,11 +137,13 @@ L.Map.TouchGesture = L.Handler.extend({
} else {
this._state = L.Map.TouchGesture.MAP;
}
+ this._moving = false;
}
if (e.isLast && this._state !== L.Map.TouchGesture.MAP) {
this._state = L.Map.TouchGesture.hitTest.MAP;
this._marker = undefined;
+ this._moving = false;
}
if ($(e.srcEvent.target).has(this._map._mapPane)) {
@@ -163,7 +165,7 @@ L.Map.TouchGesture = L.Handler.extend({
latlng = this._map.layerPointToLatLng(layerPoint),
mousePos = this._map._docLayer._latLngToTwips(latlng);
- if (this._state === L.Map.TouchGesture.MARKER || this._state === L.Map.TouchGesture.GRAPHIC) {
+ if (this._moving) {
return;
}
@@ -292,8 +294,10 @@ L.Map.TouchGesture = L.Handler.extend({
if (this._state === L.Map.TouchGesture.MARKER) {
this._map._fireDOMEvent(this._map, point, 'mousemove');
+ this._moving = true;
} else if (this._state === L.Map.TouchGesture.GRAPHIC) {
this._map._docLayer._graphicMarker._onDrag(point);
+ this._moving = true;
} else if (this._state === L.Map.TouchGesture.CURSOR) {
this._map._docLayer._postMouseEvent('move', mousePos.x, mousePos.y, 1, 1, 0);
} else {
@@ -310,8 +314,10 @@ L.Map.TouchGesture = L.Handler.extend({
if (this._state === L.Map.TouchGesture.MARKER) {
this._map._fireDOMEvent(this._map, point, 'mouseup');
+ this._moving = false;
} else if (this._state === L.Map.TouchGesture.GRAPHIC) {
this._map._docLayer._graphicMarker._onDragEnd(point);
+ this._moving = false;
} else if (this._state === L.Map.TouchGesture.CURSOR) {
this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
} else {
More information about the Libreoffice-commits
mailing list