From 67314a8bc22ea198b8e3de788282a0ca0151cb1e Mon Sep 17 00:00:00 2001 From: Caleb Date: Sun, 4 Sep 2022 00:02:19 -0400 Subject: Several functions moved --- webAO/dom/updateActionCommands.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 webAO/dom/updateActionCommands.ts (limited to 'webAO/dom/updateActionCommands.ts') diff --git a/webAO/dom/updateActionCommands.ts b/webAO/dom/updateActionCommands.ts new file mode 100644 index 0000000..9d0bd82 --- /dev/null +++ b/webAO/dom/updateActionCommands.ts @@ -0,0 +1,27 @@ + +/** + * Update evidence icon. + */ +export function updateActionCommands(side: string) { + if (side === "jud") { + document.getElementById("judge_action")!.style.display = "inline-table"; + document.getElementById("no_action")!.style.display = "none"; + } else { + document.getElementById("judge_action")!.style.display = "none"; + document.getElementById("no_action")!.style.display = "inline-table"; + } + + // Update role selector + for ( + let i = 0, + role_select = document.getElementById("role_select"); + i < role_select.options.length; + i++ + ) { + if (side === role_select.options[i].value) { + role_select.options.selectedIndex = i; + return; + } + } +} +window.updateActionCommands = updateActionCommands; \ No newline at end of file -- cgit