aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-01-25 17:56:59 -0500
committerbobzel <zzzman@gmail.com>2021-01-25 17:56:59 -0500
commit0a48a55afd868b0cc3f298407a4b4882c4ee9bd2 (patch)
treedebb98891e547a3fb2c4d54cfdf6b8defa5cfff4 /src/Utils.ts
parent2f443da0ded3020e55f23962cd8cb18e62b5834d (diff)
from last
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);