Skip to content
Snippets Groups Projects
Unverified Commit 4c3af763 authored by Rich M's avatar Rich M Committed by GitHub
Browse files

Update re Issue #13

Change to ensure that startedMove and startPos are always reset on a touchstart, and touchMoved is reset after a touchEnd.
parent a25ec59b
No related branches found
No related tags found
No related merge requests found
...@@ -105,6 +105,12 @@ ...@@ -105,6 +105,12 @@
var self = this; var self = this;
// Interaction time
this._startedMove = event.timeStamp;
// Track movement to determine if interaction was a click
self._startPos = getTouchCoords(event);
// Ignore the event if another widget is already being handled // Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) { if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return; return;
...@@ -113,15 +119,9 @@ ...@@ -113,15 +119,9 @@
// Set the flag to prevent other widgets from inheriting the touch event // Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true; touchHandled = true;
// Track movement to determine if interaction was a click
self._startPos = getTouchCoords(event);
// Track movement to determine if interaction was a click // Track movement to determine if interaction was a click
self._touchMoved = false; self._touchMoved = false;
// Interaction time
this._startedMove = event.timeStamp;
// Simulate the mouseover event // Simulate the mouseover event
simulateMouseEvent(event, 'mouseover'); simulateMouseEvent(event, 'mouseover');
...@@ -186,6 +186,9 @@ ...@@ -186,6 +186,9 @@
} }
} }
// Unset the flag to determine the touch movement stopped
this._touchMoved = false;
// Unset the flag to allow other widgets to inherit the touch event // Unset the flag to allow other widgets to inherit the touch event
touchHandled = false; touchHandled = false;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment