Disable scrolling through sidebar overlay

This commit is contained in:
Pavel Djundik 2018-03-17 09:44:42 +02:00
parent 1e8c0547ec
commit 5bb0b198e6
2 changed files with 16 additions and 7 deletions

View File

@ -2285,8 +2285,8 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
pointer-events: none;
opacity: 0;
display: none;
transition: opacity 160ms;
z-index: 1;
}
@ -2310,6 +2310,11 @@ part/quit messages where we don't load previews (adds a blank line otherwise) */
box-shadow: 0 0 25px 0 rgba(0, 0, 0, 0.5);
}
#viewport.menu-open #sidebar-overlay,
#viewport.menu-dragging #sidebar-overlay {
display: block;
}
#viewport.menu-open .messages {
pointer-events: none;
}

View File

@ -40,13 +40,17 @@ $(function() {
storage.set(name, state);
}
$("#windows").on("click", function(e) {
const isOpen = slideoutMenu.isOpen();
// If sidebar overlay is visible and it is clicked, close the sidebar
$("#sidebar-overlay").on("click", () => {
slideoutMenu.toggle(false);
storeSidebarVisibility("thelounge.state.sidebar", false);
});
if ((isOpen && $(window).outerWidth() < utils.mobileViewportPixels) || $(e.target).is(".lt")) {
slideoutMenu.toggle(!isOpen);
storeSidebarVisibility("thelounge.state.sidebar", !isOpen);
}
$("#windows").on("click", "button.lt", () => {
const isOpen = !slideoutMenu.isOpen();
slideoutMenu.toggle(isOpen);
storeSidebarVisibility("thelounge.state.sidebar", isOpen);
});
viewport.on("click", ".rt", function() {