aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.ts
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2021-12-02 14:39:40 -0500
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2021-12-02 14:39:40 -0500
commit2cb18e75aa487ff98086e15fef93e2f549c30496 (patch)
treeaf24d05b564ca4e0011aee368a38eaedb7981d64 /src/Utils.ts
parent2e6709216795e86c8b414dcb2dd45855cf23ea24 (diff)
parentc2cd77ca1d2a67539f0af2a68c1e7336b3bc232b (diff)
Merge branch 'master' into trails-aubrey
Diffstat (limited to 'src/Utils.ts')
-rw-r--r--src/Utils.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Utils.ts b/src/Utils.ts
index bfb29fe8d..f2d9e7766 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -448,7 +448,7 @@ export function returnEmptyDoclist() { return [] as any[]; }
export let emptyPath = [];
-export function emptyFunction() { }
+export function emptyFunction() { return undefined; }
export function unimplementedFunction() { throw new Error("This function is not implemented, but should be."); }
@@ -658,12 +658,6 @@ export function setupMoveUpEvents(
(target as any)._lastTap = Date.now();
(target as any)._downX = (target as any)._lastX = e.clientX;
(target as any)._downY = (target as any)._lastY = e.clientY;
- if (!(target as any)._doubleTime && noDoubleTapTimeout) {
- (target as any)._doubleTime = setTimeout(() => {
- noDoubleTapTimeout?.();
- (target as any)._doubleTime = undefined;
- }, doubleTapTimeout);
- }
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) {
@@ -685,6 +679,12 @@ export function setupMoveUpEvents(
const isClick = Math.abs(e.clientX - (target as any)._downX) < 4 && Math.abs(e.clientY - (target as any)._downY) < 4;
upEvent(e, [e.clientX - (target as any)._downX, e.clientY - (target as any)._downY], isClick);
if (isClick) {
+ if (!(target as any)._doubleTime && noDoubleTapTimeout) {
+ (target as any)._doubleTime = setTimeout(() => {
+ noDoubleTapTimeout?.();
+ (target as any)._doubleTime = undefined;
+ }, doubleTapTimeout);
+ }
if ((target as any)._doubleTime && (target as any)._doubleTap) {
clearTimeout((target as any)._doubleTime);
(target as any)._doubleTime = undefined;