mirror of
https://github.com/thelounge/thelounge
synced 2024-11-11 07:04:18 +00:00
Merge pull request #2854 from thelounge/xpaw/fix-screenx
Fix touch position being null when touching with multiple fingers
This commit is contained in:
commit
3ed7d96ea3
1 changed files with 3 additions and 4 deletions
|
@ -28,20 +28,19 @@ class SlideoutMenu {
|
|||
}
|
||||
|
||||
function onTouchStart(e) {
|
||||
touchStartPos = touchCurPos = e.touches.item(0);
|
||||
|
||||
if (e.touches.length !== 1) {
|
||||
onTouchEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
const touch = e.touches.item(0);
|
||||
const styles = window.getComputedStyle(menu);
|
||||
|
||||
menuWidth = parseFloat(styles.width);
|
||||
menuIsAbsolute = styles.position === "absolute";
|
||||
|
||||
if (!menuIsOpen || touch.screenX > menuWidth) {
|
||||
touchStartPos = touch;
|
||||
touchCurPos = touch;
|
||||
if (!menuIsOpen || touchStartPos.screenX > menuWidth) {
|
||||
touchStartTime = Date.now();
|
||||
|
||||
document.body.addEventListener("touchmove", onTouchMove, {passive: true});
|
||||
|
|
Loading…
Reference in a new issue