diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-07-10 00:53:29 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-07-10 00:53:29 +0200 |
commit | d0175eec70debe3fbabf1869f420e92c7313c2ad (patch) | |
tree | 73a21d674f57a205a23b63a301b2aed79ac097a3 /public | |
parent | 9f8cec0889c79d9ead6d077077634754761a8dc1 (diff) | |
download | server-d0175eec70debe3fbabf1869f420e92c7313c2ad.tar.gz |
Fix yellow "your turn" coloring in join and profile pages.
Diffstat (limited to 'public')
-rw-r--r-- | public/join.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/public/join.js b/public/join.js index b0b93cf..19efcde 100644 --- a/public/join.js +++ b/public/join.js @@ -71,6 +71,12 @@ function start_event_source() { } } +function is_your_turn(player, role) { + if (player.user_id === user_id) + return (game.active_role === role || game.active_role === "Both" || game.active_role === "All"); + return false; +} + function update() { window.game_status.textContent = ["Open","Active","Finished","Abandoned"][game.status]; window.game_result.textContent = game.result || "\u2014"; @@ -85,7 +91,7 @@ function update() { let element = document.getElementById(role_id); if (player) { if (game.status > 0) { - if (game.active_role === role || game.active_role === "Both" || game.active_role === "All") + if (is_your_turn(player, role)) element.className = "is_your_turn"; else element.className = ""; |