summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
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) {