From 28fdd52f8dae5fb159a052dd340f23684fd0570c Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 17 Dec 2014 15:27:11 +0100 Subject: [PATCH 1/2] Revert "Merge pull request #1416 from ahocevar/buttonclick-mobile" This reverts commit 9539afa2aee67d21f3d6a6d715ef97428910af11, reversing changes made to 541e65b71f0bf454e81945e9aece740be2103c7c. --- lib/OpenLayers/Events/buttonclick.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/OpenLayers/Events/buttonclick.js b/lib/OpenLayers/Events/buttonclick.js index d4eef17d75..8f7c33d03b 100644 --- a/lib/OpenLayers/Events/buttonclick.js +++ b/lib/OpenLayers/Events/buttonclick.js @@ -180,7 +180,6 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({ } } else if (this.startEvt) { if (this.completeRegEx.test(evt.type)) { - delete this._cancelCount; var pos = OpenLayers.Util.pagePosition(button); var viewportElement = OpenLayers.Util.getViewportElement(); var scrollTop = window.pageYOffset || viewportElement.scrollTop; @@ -197,16 +196,12 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({ }); } if (this.cancelRegEx.test(evt.type)) { - ++this._cancelCount; - if (this._cancelCount > 1) { - delete this.startEvt; - } + delete this.startEvt; } OpenLayers.Event.stop(evt); propagate = false; } if (this.startRegEx.test(evt.type)) { - this._cancelCount = 0; this.startEvt = evt; OpenLayers.Event.stop(evt); propagate = false; From a7e628397dd3199a99b852de16c777f8c001644f Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 17 Dec 2014 16:04:03 +0100 Subject: [PATCH 2/2] Better potential fix for Nexus 7 --- lib/OpenLayers/Events/buttonclick.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Events/buttonclick.js b/lib/OpenLayers/Events/buttonclick.js index 8f7c33d03b..410712f884 100644 --- a/lib/OpenLayers/Events/buttonclick.js +++ b/lib/OpenLayers/Events/buttonclick.js @@ -196,7 +196,11 @@ OpenLayers.Events.buttonclick = OpenLayers.Class({ }); } if (this.cancelRegEx.test(evt.type)) { - delete this.startEvt; + if (evt.touches && this.startEvt.touches && + (Math.abs(evt.touches[0].olClientX - this.startEvt.touches[0].olClientX) > 4 || + Math.abs(evt.touches[0].olClientY - this.startEvt.touches[0].olClientY)) > 4) { + delete this.startEvt; + } } OpenLayers.Event.stop(evt); propagate = false;