0.1.3 - voice chat settings
- added voice chat settings - fixed gestures on popups
This commit is contained in:
parent
61e2911706
commit
cb067f3785
71 changed files with 2069 additions and 77 deletions
|
|
@ -2472,6 +2472,7 @@ let touchEndX = 0;
|
|||
let touchStartY = 0;
|
||||
let touchEndY = 0;
|
||||
let touchMoved = false;
|
||||
let touchStartTarget = null;
|
||||
|
||||
let pressDate;
|
||||
|
||||
|
|
@ -2479,6 +2480,7 @@ document.addEventListener('touchstart', e => {
|
|||
touchStartX = e.changedTouches[0].screenX;
|
||||
touchStartY = e.changedTouches[0].screenY;
|
||||
touchMoved = false;
|
||||
touchStartTarget = e.target;
|
||||
|
||||
activeTouchButton = e.target.closest('button, input, textarea');
|
||||
if (activeTouchButton) {
|
||||
|
|
@ -2558,6 +2560,18 @@ document.addEventListener('contextmenu', e => {
|
|||
}
|
||||
});
|
||||
|
||||
// Swipes that begin inside floating layers (popups, dialogs, dropdowns -
|
||||
// anything rendered with position: fixed) belong to those layers and must
|
||||
// not trigger app navigation gestures.
|
||||
function touchStartedInFloatingLayer() {
|
||||
let el = touchStartTarget;
|
||||
while (el && el !== document.body && el !== document.documentElement) {
|
||||
if (getComputedStyle(el).position === 'fixed') return true;
|
||||
el = el.parentElement;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function handleMobileSwipe() {
|
||||
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||
if (window.innerWidth > 55 * rem) return;
|
||||
|
|
@ -2566,6 +2580,7 @@ function handleMobileSwipe() {
|
|||
let diffY = touchEndY - touchStartY;
|
||||
|
||||
if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 4 * rem) {
|
||||
if (touchStartedInFloatingLayer()) return;
|
||||
if (diffX > 0) {
|
||||
mobileNavBack();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue