Commit 81634438 authored by Dennis Dominik Schöpf's avatar Dennis Dominik Schöpf
Browse files

Fix menu initial state

parent ea85a5ae
/* Current state */ /* Current state */
let menuOpen = true; let menuOpen = false;
/* Store interactive elements */ /* Store interactive elements */
const menu = document.querySelector('#menu'); const menu = document.querySelector('#menu');
const menuTrigger = document.querySelector('#menu-trigger'); const menuTrigger = document.querySelector('#menu-trigger');
/* Register event listeners */ /* Register event listeners */
menuTrigger.addEventListener('click', handleMenuButtonClick); menuTrigger.addEventListener('click', (event) => handleMenuButtonClick(event));
/* Functions */ /* Functions */
function handleMenuButtonClick() { function handleMenuButtonClick(event) {
event.preventDefault();
if (menuOpen === false) { if (menuOpen === false) {
menuOpen = true; menuOpen = true;
openMenu(); openMenu();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment