mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-23 17:03:59 +03:00
fixes #1261
This commit is contained in:
parent
f0f87dbb11
commit
b32852cf3c
@ -39,11 +39,17 @@ export default {
|
||||
document.removeEventListener('pointerup', onPointerUp);
|
||||
};
|
||||
|
||||
const onPointerMove = () => {
|
||||
clearTimeout(parseInt(el.dataset.longPressTimeout, 10));
|
||||
document.removeEventListener('pointermove', onPointerMove);
|
||||
};
|
||||
|
||||
const onPointerDown = (e) => {
|
||||
// If event was right-click, then immediately trigger
|
||||
if (e.button === 2) return;
|
||||
startTime = Date.now();
|
||||
document.addEventListener('pointerup', onPointerUp);
|
||||
el.addEventListener('pointermove', onPointerMove);
|
||||
el.addEventListener('click', swallowClick);
|
||||
const timeoutDuration = LONG_PRESS_DEFAULT_DELAY;
|
||||
const timeout = setTimeout(triggerEvent, timeoutDuration);
|
||||
|
Loading…
Reference in New Issue
Block a user