Merge pull request #2785 from williamboman/fix-closing-sidebar

fix automatically closing sidebar on some mobile viewports
This commit is contained in:
Pavel Djundik 2018-09-19 10:45:17 +03:00 committed by GitHub
commit 67a28d1e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@ $(function() {
$("#sidebar-overlay").on("click", () => { $("#sidebar-overlay").on("click", () => {
slideoutMenu.toggle(false); slideoutMenu.toggle(false);
if ($(window).outerWidth() >= utils.mobileViewportPixels) { if ($(window).outerWidth() > utils.mobileViewportPixels) {
storeSidebarVisibility("thelounge.state.sidebar", false); storeSidebarVisibility("thelounge.state.sidebar", false);
} }
}); });
@ -47,7 +47,7 @@ $(function() {
slideoutMenu.toggle(isOpen); slideoutMenu.toggle(isOpen);
if ($(window).outerWidth() >= utils.mobileViewportPixels) { if ($(window).outerWidth() > utils.mobileViewportPixels) {
storeSidebarVisibility("thelounge.state.sidebar", isOpen); storeSidebarVisibility("thelounge.state.sidebar", isOpen);
} }
}); });
@ -192,7 +192,7 @@ $(function() {
utils.toggleNotificationMarkers(false); utils.toggleNotificationMarkers(false);
} }
if (!keepSidebarOpen && $(window).outerWidth() < utils.mobileViewportPixels) { if (!keepSidebarOpen && $(window).outerWidth() <= utils.mobileViewportPixels) {
slideoutMenu.toggle(false); slideoutMenu.toggle(false);
} }
} }

View File

@ -44,7 +44,7 @@ socket.on("init", function(data) {
const viewportWidth = $(window).outerWidth(); const viewportWidth = $(window).outerWidth();
let isUserlistOpen = storage.get("thelounge.state.userlist"); let isUserlistOpen = storage.get("thelounge.state.userlist");
if (viewportWidth >= utils.mobileViewportPixels) { if (viewportWidth > utils.mobileViewportPixels) {
slideoutMenu.toggle(storage.get("thelounge.state.sidebar") !== "false"); slideoutMenu.toggle(storage.get("thelounge.state.sidebar") !== "false");
} }