From 20fe476f32a8a10568eb4b7c7bd57358753bbb33 Mon Sep 17 00:00:00 2001 From: ferricles Date: Sun, 22 May 2022 01:20:07 -0700 Subject: [PATCH] more code cleanup --- js/sq2bs.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/js/sq2bs.js b/js/sq2bs.js index 268ca34..460fcd1 100644 --- a/js/sq2bs.js +++ b/js/sq2bs.js @@ -231,16 +231,12 @@ function show_tab(tab) { } function toggle_spell_tab(tab) { + let arrow_img = document.querySelector("#" + "arrow_" + tab + "Avg"); if (document.querySelector("#"+tab).style.display == "none") { document.querySelector("#"+tab).style.display = ""; - } else { - document.querySelector("#"+tab).style.display = "none"; - } - - let arrow_img = document.querySelector("#" + "arrow_" + tab + "Avg"); - if (arrow_img.src.includes("down")) { arrow_img.src = arrow_img.src.replace("down", "up"); } else { + document.querySelector("#"+tab).style.display = "none"; arrow_img.src = arrow_img.src.replace("up", "down"); } }