Rename nav-related body classes

This makes it clearer that the classes are only for navigation menu
matters. Other things should be done on media queries, or ideally,
using bootstrap components like grids.

This has a side effect of removing the smaller font size from the
body when the navigation menu is in the small-nav state.
This commit is contained in:
Andy Allan 2020-07-15 11:38:07 +02:00
parent 58050240d6
commit e157b37ce5
3 changed files with 7 additions and 7 deletions

View file

@ -81,11 +81,11 @@ $(document).ready(function () {
var windowWidth = $(window).width();
if (windowWidth < compactWidth) {
$("body").removeClass("compact").addClass("small");
$("body").removeClass("compact-nav").addClass("small-nav");
} else if (windowWidth < headerWidth) {
$("body").addClass("compact").removeClass("small");
$("body").addClass("compact-nav").removeClass("small-nav");
} else {
$("body").removeClass("compact").removeClass("small");
$("body").removeClass("compact-nav").removeClass("small-nav");
}
}
@ -100,13 +100,13 @@ $(document).ready(function () {
headerWidth = headerWidth + $(e).outerWidth();
});
$("body").addClass("compact");
$("body").addClass("compact-nav");
$("header").children(":visible").each(function (i, e) {
compactWidth = compactWidth + $(e).outerWidth();
});
$("body").removeClass("compact");
$("body").removeClass("compact-nav");
updateHeader();