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

mert (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 21 15:20:26 UTC 2020


 loleaflet/src/map/handler/Map.TouchGesture.js |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Wed Sep 16 17:31:46 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Sep 21 17:20:06 2020 +0200

    Fix pinch gesture causes hammer to stuck on Mobile
    
    Change-Id: If0ae311346a1111e9c9935ebacde3bc5ea874833
    Signed-off-by: mert <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 689e9104f..ce3ca184e 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({
 			var tripleTap = new Hammer.Tap({event: 'tripletap', taps: 3, posThreshold: posThreshold });
 			this._hammer.add(tripleTap);
 			tripleTap.recognizeWith([doubleTap, singleTap]);
-
+			var hammer = this._hammer;
 			if (L.Browser.touch) {
-				L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchend touchcancel', L.DomEvent.preventDefault);
+				L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchcancel', L.DomEvent.preventDefault);
+				L.DomEvent.on(this._map._mapPane, 'touchend', function(e) {
+					// sometimes inputs get stuck in hammer and further events get mixed with the old ones
+					// this causes to a failure to use all the gestures properly.
+					// This is a workaround until it is fixed by hammer.js
+					if (hammer.input) {
+						if (hammer.input.store)  {
+							hammer.input.store = [];
+						}
+					}
+					L.DomEvent.preventDefault(e);
+				});
 			}
 
 			if (Hammer.prefixed(window, 'PointerEvent') !== undefined) {


More information about the Libreoffice-commits mailing list