Cleanup Javascript #2185
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user