aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-02 20:14:17 +0200
committerpiernov <piernov@piernov.org>2016-05-02 20:14:17 +0200
commitcbfbedcaceccda890a7f15cb806561ede72e8044 (patch)
tree3a6ca1ec1235ad0e73e3bf5f736307a99b77efc4
parent035a477c4f30180edecead29e8bcda34a0725881 (diff)
downloadcandybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.gz
candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.bz2
candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.xz
candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.zip
Allow multiple classes on tabs
-rw-r--r--js/gui.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/js/gui.js b/js/gui.js
index bdf1710..89fa0fa 100644
--- a/js/gui.js
+++ b/js/gui.js
@@ -6,10 +6,8 @@ function changeTab() {
var id = window.location.hash.substr(4);
var tabs = document.querySelectorAll("#tabs-panel > ul > li");
for(var i=0; i < tabs.length; i++) {
- if(i == id-1)
- tabs[i].className = "active";
- else
- tabs[i].className = "";
+ if(i == id-1) tabs[i].classList.add("active"); // Doesn't work with IE < 10 (and Opera Mini), but who cares?
+ else tabs[i].classList.remove("active");
}
}