From 8bef982a2a98a2bb12e49b9c2bccd832b645dc75 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 20 Oct 2023 19:03:59 +0200 Subject: Mobile layout. --- play.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'play.js') 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) { -- cgit v1.2.3