Skip to content

Commit

Permalink
Use fixed small/compact nav breakpoint width
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed May 29, 2024
1 parent 79a6ceb commit adc05e4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ $(document).ready(function () {
Turbo.session.drive = false;

var headerWidth = 0,
compactWidth = 0;
breakpointWidth = 768;

function updateHeader() {
var windowWidth = $(window).width();

if (windowWidth < compactWidth) {
if (windowWidth < breakpointWidth) {
$("body").addClass("small-nav");
expandSecondaryMenu();
} else if (windowWidth < headerWidth) {
Expand Down Expand Up @@ -125,12 +125,6 @@ $(document).ready(function () {
headerWidth = headerWidth + $(e).outerWidth();
});

collapseSecondaryMenu();

$("header").children(":visible").each(function (i, e) {
compactWidth = compactWidth + $(e).outerWidth();
});

$("header").removeClass("text-nowrap");
$("header nav.secondary > ul").removeClass("flex-nowrap");

Expand Down

0 comments on commit adc05e4

Please sign in to comment.