Scrollable unit control panel tweak

This commit is contained in:
Pax1601
2023-11-09 08:26:43 +01:00
parent 9caee0c77c
commit c8254238c7
2 changed files with 6 additions and 0 deletions

View File

@@ -161,6 +161,7 @@ export class UnitControlPanel extends Panel {
this.#followRoadsSwitch.resetExpectedValue();
this.#altitudeSlider.resetExpectedValue();
this.#speedSlider.resetExpectedValue();
this.#calculateMaxHeight();
}
addButtons() {
@@ -486,6 +487,7 @@ export class UnitControlPanel extends Panel {
#calculateMaxHeight() {
const element = document.getElementById("unit-control-panel-content");
this.#calculateTop();
if (element)
element.style.maxHeight = `${window.innerHeight - this.getElement().offsetTop - 10}px`;
}