From 0ee99cff51f753b2c4f75a7f8f0e4574b405fd91 Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 29 Jan 2024 10:52:53 +0100 Subject: [PATCH 1/2] Fix secondary links bug --- static/js/src/navigation.js | 4 ++-- static/sass/_pattern_navigation.scss | 4 ++++ templates/templates/meganav/base.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/src/navigation.js b/static/js/src/navigation.js index 3009493a71d..a925fa793ac 100644 --- a/static/js/src/navigation.js +++ b/static/js/src/navigation.js @@ -59,10 +59,10 @@ mainList.addEventListener("click", function (e) { handleDropdownClick(e.target.parentNode); } } else if ( - target.classList.contains("p-navigation__dropdown") && + target.classList.contains("p-navigation__dropdown-item") || + target.classList.contains("p-navigation__secondary-link") && target.tagName == "A" ) { - // This handles the globa-nav using a slightly different class naming convention window.location.href = target.href; } }); diff --git a/static/sass/_pattern_navigation.scss b/static/sass/_pattern_navigation.scss index 0024588aba1..2eedb1a6b43 100644 --- a/static/sass/_pattern_navigation.scss +++ b/static/sass/_pattern_navigation.scss @@ -38,6 +38,10 @@ $meganav-height: 3rem; top: 0; z-index: 40; + .p-navigation__secondary-link { + @extend .dropdown-window__side-panel-link; + } + .p-link--inverted { font-weight: 400; } diff --git a/templates/templates/meganav/base.html b/templates/templates/meganav/base.html index 0a435a7013d..0ff848ebc6e 100644 --- a/templates/templates/meganav/base.html +++ b/templates/templates/meganav/base.html @@ -244,7 +244,7 @@

{{ links_section.title }}

{% for link in links_section.links %}
  • - {{ link.title }} + {{ link.title }}
  • {% endfor %} From ee1b5c339c1e8f40c6c66aad8d6c6d1b19ced1cd Mon Sep 17 00:00:00 2001 From: Pete Date: Mon, 29 Jan 2024 11:32:41 +0100 Subject: [PATCH 2/2] Run linter --- static/js/src/navigation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/src/navigation.js b/static/js/src/navigation.js index a925fa793ac..eb04956374a 100644 --- a/static/js/src/navigation.js +++ b/static/js/src/navigation.js @@ -60,8 +60,8 @@ mainList.addEventListener("click", function (e) { } } else if ( target.classList.contains("p-navigation__dropdown-item") || - target.classList.contains("p-navigation__secondary-link") && - target.tagName == "A" + (target.classList.contains("p-navigation__secondary-link") && + target.tagName == "A") ) { window.location.href = target.href; }