mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 11:58:25 -04:00
subnav
This commit is contained in:
29
app/assets/javascripts/subNav.js
Normal file
29
app/assets/javascripts/subNav.js
Normal file
@@ -0,0 +1,29 @@
|
||||
(function(window) {
|
||||
"use strict";
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const sideNavLinks = document.querySelectorAll('.usa-sidenav__item');
|
||||
const currentURL = window.location.pathname;
|
||||
|
||||
sideNavLinks.forEach(link => {
|
||||
const sublist = link.querySelector('.usa-sidenav__sublist');
|
||||
const parentLink = link.querySelector('a');
|
||||
|
||||
const isMatch = parentLink && sublist && currentURL === parentLink.getAttribute('href');
|
||||
if (isMatch) {
|
||||
sublist.classList.replace('display-none', 'display-block');
|
||||
}
|
||||
|
||||
link.addEventListener('click', function(event) {
|
||||
if (sublist && event.target === parentLink) {
|
||||
event.preventDefault();
|
||||
|
||||
sublist.classList.toggle('display-none');
|
||||
sublist.classList.toggle('display-block');
|
||||
|
||||
setTimeout(() => window.location.href = parentLink.href, 100);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})(window);
|
||||
@@ -831,13 +831,14 @@ $do-dont-top-bar-width: 1;
|
||||
transition: transform 0.3s ease, background-color 0.3s ease,
|
||||
}
|
||||
|
||||
li.linked-card > div:first-child {
|
||||
li.linked-card:hover > div:first-child:hover {
|
||||
border-color: #005ea2;
|
||||
}
|
||||
|
||||
li.linked-card:hover h4,
|
||||
li.linked-card:hover p,
|
||||
.guidance_card_img{
|
||||
li.linked-card:hover svg,
|
||||
.guidance_card_img:hover{
|
||||
color: #005ea2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user