Hide navigation menu in mobile

In the mobile with the menu open, the page itself is too narrow. Therefore, I propose to close the navigation menu. Intuitively, it opens due to the presence of a burger. And closing does not look so intuitive as in most other sites and applications the navigation menu is initially hidden
This commit is contained in:
sbagdaulet
2019-05-31 14:31:33 +06:00
committed by GitHub
parent a749325221
commit 1782569731

View File

@@ -15,6 +15,13 @@
if ($(window).width() < 768) { if ($(window).width() < 768) {
$('.sidebar .collapse').collapse('hide'); $('.sidebar .collapse').collapse('hide');
}; };
// Toggle the side navigation when window is resized below 480px
if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) {
$("body").addClass("sidebar-toggled");
$(".sidebar").addClass("toggled");
$('.sidebar .collapse').collapse('hide');
};
}); });
// Prevent the content wrapper from scrolling when the fixed side navigation hovered over // Prevent the content wrapper from scrolling when the fixed side navigation hovered over