import { TAG_NAME } from "/assets/js/snippets/HTMLNavMenuElement.mjs";

// Bind toggles for the nav menu
[...document.querySelectorAll("[data-menu]")].forEach(element => {
	element.addEventListener("click", () => document.querySelector(TAG_NAME).toggle());
});

// Scroll page to the top on navigations
document.addEventListener(vegvisir.Navigation.EVENTS.FINISHED, () => window.scrollTo({ top: 0 }));