(trunk web) simplify the prefs tab selection code

This commit is contained in:
Jordan Lee
2011-08-25 08:03:19 +00:00
parent 465d57eb71
commit 00dfd6ce67
4 changed files with 25 additions and 51 deletions

View File

@@ -171,30 +171,6 @@ String.prototype.compareTo = function(that) {
return 0;
}
/**
* @brief Switch between different dialog tabs
*/
function changeTab(tab, id) {
for (var x = 0, node; tab.parentNode.childNodes[x]; x++) {
node = tab.parentNode.childNodes[x];
if (node == tab) {
node.className = "prefs_tab_enabled";
} else {
node.className = "prefs_tab_disabled";
}
}
for (x = 0; tab.parentNode.parentNode.childNodes[x]; x++) {
node = tab.parentNode.parentNode.childNodes[x];
if (node.tagName == "DIV") {
if (node.id == id) {
node.style.display = "block";
} else {
node.style.display = "none";
}
}
}
}
/***
**** Preferences
***/