aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/updateActionCommands.ts
blob: 536292bf0b92e85ea5a9ac068320c422464642c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * 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 = <HTMLSelectElement>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;