diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-10-20 19:03:59 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-10-20 19:22:00 +0200 |
commit | 8bef982a2a98a2bb12e49b9c2bccd832b645dc75 (patch) | |
tree | acfc6c3efdb47f8f3250e844c85e5e5ffdcdbcd9 /play.js | |
parent | 21eb4623ffaf9a86986f3a9ac5d61b9cb38171cf (diff) | |
download | rommel-in-the-desert-8bef982a2a98a2bb12e49b9c2bccd832b645dc75.tar.gz |
Mobile layout.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -945,7 +945,11 @@ function update_battle_line(hex, line, test) { } function update_battle() { - ui.battle.classList.remove("hide") + if (ui.battle.classList.contains("hide")) { + ui.battle.classList.remove("hide") + ui.battle.scrollIntoView({ block: "center", inline: "center", behavior: "smooth" }) + + } ui.battle_header.textContent = hex_name[view.battle] ui.battle_message.textContent = view.flash if (player === ALLIED) { @@ -970,7 +974,11 @@ function update_battle() { } function update_pursuit() { - ui.pursuit.classList.remove("hide") + if (ui.pursuit.classList.contains("hide")) { + ui.pursuit.classList.remove("hide") + ui.pursuit.scrollIntoView({ block: "center", inline: "center", behavior: "smooth" }) + + } ui.pursuit_header.textContent = "Pursuit Fire at " + hex_name[view.pursuit] ui.pursuit_message.textContent = view.flash if (player === ALLIED) { |