summaryrefslogblamecommitdiff
path: root/js/navigation.ts
blob: 1e9ec819893887d90a9e247967a4c39431815728 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                 
function toggleSideMenu() {
	let navBar   = document.getElementById("navBar");
	let sideMenu = document.getElementById("sideMenu");

	if (!navBar) {
		throw new Error("unable to find navigation bar");
	}

	if (!sideMenu) {
		throw new Error("unable to find side menu");
	}

	sideMenu.classList.toggle("visible");

	for (let link of navBar.getElementsByTagName("a")) {
		link.classList.toggle("hidden");
	}
}