diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -77,6 +77,9 @@ let ui = { zones: [], units: [], units_holder: document.getElementById("units"), + fln_supply_panel: document.getElementById("fln_supply_panel"), + gov_supply_panel: document.getElementById("gov_supply_panel"), + eliminated_panel: document.getElementById("eliminated_panel"), fln_supply: document.getElementById("fln_supply"), gov_supply: document.getElementById("gov_supply"), eliminated: document.getElementById("eliminated"), @@ -465,6 +468,11 @@ function update_map() { } } + // Hide supply panels when empty + ui.fln_supply_panel.classList.toggle("hide", !(ui.fln_supply.childNodes.length - 1)) + ui.gov_supply_panel.classList.toggle("hide", !(ui.gov_supply.childNodes.length - 1)) + ui.eliminated_panel.classList.toggle("hide", !(ui.eliminated.childNodes.length - 1)) + for (let i = 0; i < ui.areas.length; ++i) { let e = ui.areas[i] if (e) { |