summaryrefslogtreecommitdiff
path: root/js/toggleNavBar.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/toggleNavBar.ts')
-rw-r--r--js/toggleNavBar.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/toggleNavBar.ts b/js/toggleNavBar.ts
new file mode 100644
index 0000000..329a223
--- /dev/null
+++ b/js/toggleNavBar.ts
@@ -0,0 +1,15 @@
+/// <reference path="setNavBarState.ts" />
+
+function toggleNavBar() {
+ let nav_bar = document.getElementById("navBar")!;
+
+ let state = NavBarState[nav_bar?.getAttribute("data-state")!];
+
+ if (state == NavBarState.Visible) {
+ state = NavBarState.Hidden;
+ } else if (state == NavBarState.Hidden) {
+ state = NavBarState.Visible;
+ };
+
+ setNavBarState(state);
+}