All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.navigation.js Maven / Gradle / Ivy

Go to download

This starter is designed to provide the CoffeeNet navigation components

The newest version!
const header = document.getElementById('coffeenet--header-container');
const initiallyVisible = localStorage.getItem('coffee::nav::visible') === 'true';

function handleHamburgerClick() {
    header.classList.toggle('visible');
    localStorage.setItem('coffee::nav::visible', header.classList.contains('visible'));
}

if (initiallyVisible) {
    header.classList.add('visible');
}

if (header != null) {
    header.addEventListener('click', event => {
            if (event.target.id === 'coffeenet--nav-hamburger' || event.target.parentNode.id === 'coffeenet--nav-hamburger') {
                handleHamburgerClick();
            }
        }
    );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy