fix automatically closing sidebar on some mobile viewports
Co-authored-by: Pavel Djundik <github@xpaw.me> Mobile viewports whose width is equal to the upper boundary of the mobile viewport breakpoint would not automatically close the sidebar when selecting an item in it. Closes #2783.
This commit is contained in:
parent
2745931e9e
commit
658dc5a3a2
@ -37,7 +37,7 @@ $(function() {
|
||||
$("#sidebar-overlay").on("click", () => {
|
||||
slideoutMenu.toggle(false);
|
||||
|
||||
if ($(window).outerWidth() >= utils.mobileViewportPixels) {
|
||||
if ($(window).outerWidth() > utils.mobileViewportPixels) {
|
||||
storeSidebarVisibility("thelounge.state.sidebar", false);
|
||||
}
|
||||
});
|
||||
@ -47,7 +47,7 @@ $(function() {
|
||||
|
||||
slideoutMenu.toggle(isOpen);
|
||||
|
||||
if ($(window).outerWidth() >= utils.mobileViewportPixels) {
|
||||
if ($(window).outerWidth() > utils.mobileViewportPixels) {
|
||||
storeSidebarVisibility("thelounge.state.sidebar", isOpen);
|
||||
}
|
||||
});
|
||||
@ -192,7 +192,7 @@ $(function() {
|
||||
utils.toggleNotificationMarkers(false);
|
||||
}
|
||||
|
||||
if (!keepSidebarOpen && $(window).outerWidth() < utils.mobileViewportPixels) {
|
||||
if (!keepSidebarOpen && $(window).outerWidth() <= utils.mobileViewportPixels) {
|
||||
slideoutMenu.toggle(false);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ socket.on("init", function(data) {
|
||||
const viewportWidth = $(window).outerWidth();
|
||||
let isUserlistOpen = storage.get("thelounge.state.userlist");
|
||||
|
||||
if (viewportWidth >= utils.mobileViewportPixels) {
|
||||
if (viewportWidth > utils.mobileViewportPixels) {
|
||||
slideoutMenu.toggle(storage.get("thelounge.state.sidebar") !== "false");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user