close theme dropmenu when sidebar collapses
This commit is contained in:
parent
2571630c41
commit
8a563ca51e
@ -222,11 +222,18 @@ $(".sidebar-backdrop").on("click", () => setSidebarVisibility(false));
|
||||
|
||||
// Prevent sidebar from opening if the screen becomes larger then smaller again, while it's visible
|
||||
$(window).on('resize', () => {
|
||||
const sidebarVisibility = getSidebarVisibility();
|
||||
|
||||
// Can't pass conditional directly, causes flickering effect
|
||||
if (getSidebarVisibility() && $(window).width() > 992) {
|
||||
if (sidebarVisibility && $(window).width() > 992) {
|
||||
setSidebarPinned(false);
|
||||
setSidebarVisibility(false);
|
||||
}
|
||||
|
||||
// Close the theme menu when the sidebar collapses offscreen
|
||||
else if (!sidebarVisibility && $(window).width() <= 992) {
|
||||
$(".js-themeMenuBtn").dropdown("hide");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user