Skip to content

Commit

Permalink
Hide navigation menu in mobile
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbagdaulet authored May 31, 2019
1 parent a749325 commit 1782569
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/sb-admin-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
if ($(window).width() < 768) {
$('.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
Expand Down

0 comments on commit 1782569

Please sign in to comment.