aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-ui.js
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-14 14:15:10 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-14 14:15:10 +0200
commit36ba81c8b4ce3bced4898d45853d2b736ef9b2b4 (patch)
tree892d968432b0899582e37235c8da7b946e33f598 /web/js/nms-ui.js
parent55f2f43db3b82cacaf459a374176a8ddd56c1b73 (diff)
Add tabs for admin/map
The admin-tab is currently empty. That is besides the point. Closes #18
Diffstat (limited to 'web/js/nms-ui.js')
-rw-r--r--web/js/nms-ui.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/web/js/nms-ui.js b/web/js/nms-ui.js
new file mode 100644
index 0000000..411ed2f
--- /dev/null
+++ b/web/js/nms-ui.js
@@ -0,0 +1,23 @@
+"use strict";
+
+
+/*
+ * The idea is to gradually move pure UI stuff into nmsUi.
+ */
+var nmsUi = nmsUi || {
+ _active: "map"
+};
+
+nmsUi.setActive = function(pane) {
+ var old = document.getElementById(nmsUi._active);
+ var newp = document.getElementById(pane);
+ old.style.display = "none";
+ newp.style.display = "block";
+
+ var oldlink = document.getElementById(nmsUi._active + "-link");
+ var newlink = document.getElementById(pane + "-link");
+ oldlink.classList.remove("active");
+ newlink.classList.add("active");
+
+ nmsUi._active = pane;
+}