From 8a84f23dde3358545f5e48e00c73bd3b98e31163 Mon Sep 17 00:00:00 2001 From: reschan Date: Thu, 28 Jul 2022 21:00:13 +0700 Subject: [PATCH] remove duplicate tab functions and document tab functions --- builder/index_full.html | 10 +++++----- js/builder.js | 17 +++-------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/builder/index_full.html b/builder/index_full.html index 5eb6b88..0c66692 100644 --- a/builder/index_full.html +++ b/builder/index_full.html @@ -447,19 +447,19 @@
-
+
Earth
-
+
Thunder
-
+
Water
-
+
Fire
-
+
Air
diff --git a/js/builder.js b/js/builder.js index 4215577..e24b31a 100644 --- a/js/builder.js +++ b/js/builder.js @@ -124,7 +124,7 @@ function toggleButton(button_id) { } } -// toggle tab +// Toggles display of a certain element, given the ID. function toggle_tab(tab) { if (document.querySelector("#"+tab).style.display == "none") { document.querySelector("#"+tab).style.display = ""; @@ -133,20 +133,9 @@ function toggle_tab(tab) { } } -function toggle_boost_tab(tab) { - for (const i of skp_order) { - document.querySelector("#"+i+"-boost").style.display = "none"; - document.getElementById(i + "-boost-tab").classList.remove("selected-btn"); - } - document.querySelector("#"+tab+"-boost").style.display = ""; - document.getElementById(tab + "-boost-tab").classList.add("selected-btn"); -} - -// let tabs = ['overall-stats', 'offensive-stats', 'defensive-stats']; - +// Toggle display of a certain tab, in a group of tabs, given the target tab ID, and a list of associated tabs. +// Also sets visual display of an element with ID of target + "-btn" to selected. function show_tab(target, tabs) { - //console.log(itemFilters) - //hide all tabs, then show the tab of the div clicked and highlight the correct button for (const i in tabs) { document.querySelector("#" + tabs[i]).style.display = "none";