refactor tabs

This commit is contained in:
Nils Schneider 2015-03-29 21:44:05 +02:00
parent eded0eb19c
commit 33bd730576

View file

@ -7,15 +7,19 @@ define([], function () {
var container = document.createElement("div")
function switchTab() {
function gotoTab(li) {
for (var i = 0; i < tabs.children.length; i++) {
var el = tabs.children[i]
el.classList.remove("visible")
el.tab.classList.remove("visible")
}
this.classList.add("visible")
this.tab.classList.add("visible")
li.classList.add("visible")
li.tab.classList.add("visible")
}
function switchTab() {
gotoTab(this)
return false
}