Ensure links in chats cannot be opened by accident when closing the channel list

This commit is contained in:
Jérémie Astori 2018-03-17 03:12:30 -04:00
parent 4c0479fe3d
commit cf49a3427e
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
2 changed files with 8 additions and 7 deletions

View File

@ -518,7 +518,7 @@ kbd {
width: 220px;
}
#sidebar.menu-open {
#viewport.menu-open #sidebar {
display: none;
will-change: transform;
}
@ -2278,16 +2278,16 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
transform: translateZ(0);
}
#sidebar.menu-open {
#viewport.menu-open #sidebar {
display: flex;
transform: translate3d(220px, 0, 0);
}
#sidebar.menu-dragging {
#viewport.menu-dragging #sidebar {
transition: none !important;
}
#sidebar.menu-open .messages {
#viewport.menu-open .messages {
pointer-events: none;
}

View File

@ -1,5 +1,6 @@
"use strict";
const viewport = document.getElementById("viewport");
const menu = document.getElementById("sidebar");
let touchStartPos = null;
@ -16,7 +17,7 @@ class SlideoutMenu {
static toggle(state) {
menuIsOpen = state;
menu.classList.toggle("menu-open", state);
viewport.classList.toggle("menu-open", state);
}
static isOpen() {
@ -39,7 +40,7 @@ function onTouchStart(e) {
touchCurPos = touch;
touchStartTime = Date.now();
menu.classList.toggle("menu-dragging", true);
viewport.classList.toggle("menu-dragging", true);
document.body.addEventListener("touchmove", onTouchMove);
document.body.addEventListener("touchend", onTouchEnd, {passive: true});
}
@ -86,7 +87,7 @@ function onTouchEnd() {
document.body.removeEventListener("touchmove", onTouchMove);
document.body.removeEventListener("touchend", onTouchEnd);
menu.classList.toggle("menu-dragging", false);
viewport.classList.toggle("menu-dragging", false);
menu.style.transform = null;
touchStartPos = null;