From 58cb429fff2cf4d947d365906dc34dcf21ba2116 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 18 Oct 2023 00:35:42 +0200 Subject: Mobile layout. --- play.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index fcaf290..711e566 100644 --- a/play.js +++ b/play.js @@ -428,11 +428,6 @@ function is_action(action, arg) { return !!(view.actions && view.actions[action] && set_has(view.actions[action], arg)) } -function toggle_zoom2() { - document.querySelector("main").classList.toggle("fit") - toggle_zoom() -} - function toggle_pieces() { if (ui.map.classList.contains("hide_tokens")) { ui.map.classList.remove("hide_tokens") @@ -1590,4 +1585,14 @@ function map_get(map, key, missing) { return missing } +// TODO: clean up this mess... +var orig_toggle_zoom = toggle_zoom +toggle_zoom = function () { + orig_toggle_zoom() + if (document.getElementById("mapwrap").classList.contains("fit")) + document.getElementById("grid").classList.add("fit") + else + document.getElementById("grid").classList.remove("fit") +} + scroll_with_middle_mouse("main") -- cgit v1.2.3