Another ReferenceError Fix

This commit is contained in:
Gusted
2021-01-10 18:51:16 +01:00
parent c005ad9df7
commit 7734771452

View File

@ -16,12 +16,6 @@ const navSectionsToggle = () => {
}
}
navSections.forEach(navSection => {
navSection.addEventListener("toggle", navSectionsToggle);
});
document.addEventListener("click", navSectionsClose);
const navSectionsClose = (event) => {
// Hide all dropdowns when clicking in different place
if (
@ -35,6 +29,11 @@ const navSectionsClose = (event) => {
}
navSections.forEach(navSection => {
navSection.addEventListener("toggle", navSectionsToggle);
});
document.addEventListener("click", navSectionsClose);
// Dark/Light color scheme switch button
document.querySelector("#nav-switch-theme").style.display = "inline";
document.querySelector("#nav-switch-theme").addEventListener("click", changeColorScheme);