aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authoranika <anika.ahluwalia@gmail.com>2021-01-27 20:35:50 -0500
committeranika <anika.ahluwalia@gmail.com>2021-01-27 20:35:50 -0500
commit8a44fab7131c713937d92c2ac29265d4e2bd54d5 (patch)
tree74e24dddb475feb05a3dc71b1c10a9a56b65c623 /src/Utils.ts
parent7941773a61573db14cbf425d07ab0ff9b8ce5d33 (diff)
parente3db0536ad0086a328ee353be1c4dfd34ba03e02 (diff)
Merge branch 'filters' of https://github.com/browngraphicslab/Dash-Web into filters
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index f160df6f7..3cf695a30 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -614,6 +614,10 @@ export function setupMoveUpEvents(
const _moveEvent = (e: PointerEvent): void => {
if (Math.abs(e.clientX - (target as any)._downX) > Utils.DRAG_THRESHOLD || Math.abs(e.clientY - (target as any)._downY) > Utils.DRAG_THRESHOLD) {
+ if ((target as any)._doubleTime) {
+ clearTimeout((target as any)._doubleTime);
+ (target as any)._doubleTime = undefined;
+ }
if (moveEvent(e, [(target as any)._downX, (target as any)._downY],
[e.clientX - (target as any)._lastX, e.clientY - (target as any)._lastY])) {
document.removeEventListener("pointermove", _moveEvent);
@@ -630,6 +634,10 @@ export function setupMoveUpEvents(
(target as any)._lastTap = Date.now();
upEvent(e, [e.clientX - (target as any)._downX, e.clientY - (target as any)._downY]);
if (Math.abs(e.clientX - (target as any)._downX) < 4 && Math.abs(e.clientY - (target as any)._downY) < 4) {
+ if ((target as any)._doubleTime && (target as any)._doubleTap) {
+ clearTimeout((target as any)._doubleTime);
+ (target as any)._doubleTime = undefined;
+ }
clickEvent(e, (target as any)._doubleTap);
}
document.removeEventListener("pointermove", _moveEvent);