Skip to content

Commit

Permalink
Minor bug fixes (#13467)
Browse files Browse the repository at this point in the history
* Minor bug fixes

* Make global-nav link detection more specific

* Fix linter errors
  • Loading branch information
petesfrench authored Jan 18, 2024
1 parent b32ed85 commit a67f793
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 8 additions & 2 deletions static/js/src/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ mainList.addEventListener("click", function (e) {
} else {
handleDropdownClick(e.target.parentNode);
}
} else if (
target.classList.contains("p-navigation__dropdown") &&
target.tagName == "A"
) {
// This handles the globa-nav using a slightly different class naming convention
window.location.href = target.href;
}
});

Expand Down Expand Up @@ -105,8 +111,8 @@ function toggleSecondaryMobileNavDropdown(e) {
} else {
isDropdownOpen = true;
}
mobileNavDropdown.classList.toggle("is-open", !isDropdownOpen);
mobileNavDropdownToggle.classList.toggle("is-open", !isDropdownOpen);
mobileNavDropdown?.classList.toggle("is-open", !isDropdownOpen);
mobileNavDropdownToggle?.classList.toggle("is-open", !isDropdownOpen);
}

function handleDropdownClick(clickedDropdown) {
Expand Down
11 changes: 10 additions & 1 deletion static/sass/_pattern_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ $meganav-height: 3rem;
}

.p-search-box__input {
background-color: #f2f2f2 !important;
background-color: $color-light !important;

&:focus,
&:hover {
background-color: $color-light !important;
}
}

.p-search-box__input::placeholder {
Expand Down Expand Up @@ -188,6 +193,10 @@ $meganav-height: 3rem;

&[aria-hidden="false"] {
overflow: unset;

&::before {
pointer-events: none;
}
}
}

Expand Down

0 comments on commit a67f793

Please sign in to comment.