summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-20 19:03:59 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-20 19:22:00 +0200
commit8bef982a2a98a2bb12e49b9c2bccd832b645dc75 (patch)
treeacfc6c3efdb47f8f3250e844c85e5e5ffdcdbcd9 /play.js
parent21eb4623ffaf9a86986f3a9ac5d61b9cb38171cf (diff)
downloadrommel-in-the-desert-8bef982a2a98a2bb12e49b9c2bccd832b645dc75.tar.gz
Mobile layout.
Diffstat (limited to 'play.js')
-rw-r--r--play.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/play.js b/play.js
index 56802ce..dfa7f6a 100644
--- a/play.js
+++ b/play.js
@@ -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) {