2021-02-01 21:35:06 +01:00
|
|
|
document.getElementsByClassName('primary_nav__toggle')[0].addEventListener('click', function(){
|
2024-01-21 21:40:37 +01:00
|
|
|
let nav_list = document.getElementsByClassName('primary_nav__navlist')[0]
|
2020-12-22 14:47:58 +01:00
|
|
|
if (nav_list.style.display === 'block') {
|
|
|
|
nav_list.style.display = 'none';
|
|
|
|
} else {
|
|
|
|
nav_list.style.display = 'block';
|
|
|
|
}
|
|
|
|
});
|
2024-01-21 21:42:06 +01:00
|
|
|
|
|
|
|
let primary_menu_items = document.getElementsByClassName('primary_nav__navitem');
|
|
|
|
for (let i = 0; i < primary_menu_items.length; i++) {
|
|
|
|
primary_menu_items[i].addEventListener('click', function(event) {
|
2024-01-21 21:50:20 +01:00
|
|
|
let dropdown = event.currentTarget.children[1];
|
2024-01-21 21:42:06 +01:00
|
|
|
if (dropdown.classList.contains('-closed')) {
|
|
|
|
dropdown.classList.remove('-closed');
|
|
|
|
dropdown.classList.add('-open');
|
|
|
|
} else {
|
|
|
|
dropdown.classList.remove('-open');
|
|
|
|
dropdown.classList.add('-closed');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|