diff options
| author | Aubrey Li <Aubrey-Li> | 2021-12-02 15:06:27 -0500 |
|---|---|---|
| committer | Aubrey Li <Aubrey-Li> | 2021-12-02 15:06:27 -0500 |
| commit | 3ce1455986d4f42c75c8aabc8aec56805e655747 (patch) | |
| tree | 82eb891e8f7093cf60962a6fb92a1ef642a4c194 /src/Utils.ts | |
| parent | 657a4c11b6b1526bacc79fbefe4b461e932c75e7 (diff) | |
| parent | 2cb18e75aa487ff98086e15fef93e2f549c30496 (diff) | |
Merge branch 'trails-aubrey' of https://github.com/brown-dash/Dash-Web into trails-aubrey
Diffstat (limited to 'src/Utils.ts')
| -rw-r--r-- | src/Utils.ts | 14 |
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; |
