Use fixed small/compact nav breakpoint width
This commit is contained in:
parent
424316b41c
commit
c8757cf1d0
1 changed files with 3 additions and 9 deletions
|
@ -90,13 +90,13 @@ $(document).ready(function () {
|
|||
// See https://turbo.hotwired.dev/reference/drive#turbo.session.drive
|
||||
Turbo.session.drive = false;
|
||||
|
||||
var headerWidth = 0,
|
||||
compactWidth = 0;
|
||||
let headerWidth = 0;
|
||||
const breakpointWidth = 768;
|
||||
|
||||
function updateHeader() {
|
||||
var windowWidth = $(window).width();
|
||||
|
||||
if (windowWidth < compactWidth) {
|
||||
if (windowWidth < breakpointWidth) {
|
||||
$("body").addClass("small-nav");
|
||||
expandSecondaryMenu();
|
||||
} else if (windowWidth < headerWidth) {
|
||||
|
@ -142,12 +142,6 @@ $(document).ready(function () {
|
|||
headerWidth += $(e).outerWidth();
|
||||
});
|
||||
|
||||
collapseSecondaryMenu();
|
||||
|
||||
$("header").children(":visible").each(function (i, e) {
|
||||
compactWidth += $(e).outerWidth();
|
||||
});
|
||||
|
||||
$("header").removeClass("text-nowrap");
|
||||
$("header nav.secondary > ul").removeClass("flex-nowrap");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue