aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/toggleShout.ts
diff options
context:
space:
mode:
authorstonedDiscord <stonedDiscord@users.noreply.github.com>2024-11-20 13:31:50 +0000
committerGitHub Action <actions@github.com>2024-11-20 13:31:50 +0000
commit6684f3fce6e90fd0574d7bab63b629554ab03ef6 (patch)
treeb2a62247d17e23a77af57aea355ba621666817c2 /webAO/dom/toggleShout.ts
parent95a2d1361d84c61b454ebe506e6963b93f6d8dee (diff)
Prettified Code!
Diffstat (limited to 'webAO/dom/toggleShout.ts')
-rw-r--r--webAO/dom/toggleShout.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/webAO/dom/toggleShout.ts b/webAO/dom/toggleShout.ts
index cb12f49..dcfccba 100644
--- a/webAO/dom/toggleShout.ts
+++ b/webAO/dom/toggleShout.ts
@@ -6,16 +6,17 @@ import { selectedShout, setSelectedShout } from "../client";
* @param {number} shout the new shout to be selected
*/
export function toggleShout(shout: number) {
- if (shout === selectedShout) {
- document.getElementById(`button_${shout}`)!.className = "client_button";
- setSelectedShout(0);
- } else {
- document.getElementById(`button_${shout}`)!.className = "client_button dark";
- if (selectedShout) {
- document.getElementById(`button_${selectedShout}`)!.className =
- "client_button";
- }
- setSelectedShout(shout);
+ if (shout === selectedShout) {
+ document.getElementById(`button_${shout}`)!.className = "client_button";
+ setSelectedShout(0);
+ } else {
+ document.getElementById(`button_${shout}`)!.className =
+ "client_button dark";
+ if (selectedShout) {
+ document.getElementById(`button_${selectedShout}`)!.className =
+ "client_button";
}
+ setSelectedShout(shout);
+ }
}
window.toggleShout = toggleShout;