Merge pull request #2785 from williamboman/fix-closing-sidebar
fix automatically closing sidebar on some mobile viewports
This commit is contained in:
commit
67a28d1e94
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user