Fix referenceError
This commit is contained in:
@ -5,11 +5,6 @@ document.querySelectorAll(".onclick-select").forEach((element) => {
|
|||||||
// Navbar dropdowns
|
// Navbar dropdowns
|
||||||
const navSections = document.querySelectorAll(".nav-details");
|
const navSections = document.querySelectorAll(".nav-details");
|
||||||
|
|
||||||
navSections.forEach(navSection => {
|
|
||||||
navSection.addEventListener("toggle", navSectionsToggle);
|
|
||||||
});
|
|
||||||
document.addEventListener("click", navSectionsClose);
|
|
||||||
|
|
||||||
const navSectionsToggle = () => {
|
const navSectionsToggle = () => {
|
||||||
// When opening next dropdown, hide previous
|
// When opening next dropdown, hide previous
|
||||||
if (this.open) {
|
if (this.open) {
|
||||||
@ -21,6 +16,12 @@ const navSectionsToggle = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
navSections.forEach(navSection => {
|
||||||
|
navSection.addEventListener("toggle", navSectionsToggle);
|
||||||
|
});
|
||||||
|
document.addEventListener("click", navSectionsClose);
|
||||||
|
|
||||||
|
|
||||||
const navSectionsClose = (event) => {
|
const navSectionsClose = (event) => {
|
||||||
// Hide all dropdowns when clicking in different place
|
// Hide all dropdowns when clicking in different place
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user