aboutsummaryrefslogtreecommitdiff
path: root/webAO/dom/updateActionCommands.ts
blob: 9d0bd828288c057ac2cbc6ad13d71690ab1fa3de (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
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 = <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;