From c8254238c7c1fcd0d14bea7645d5706a6973b1e3 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Thu, 9 Nov 2023 08:26:43 +0100 Subject: [PATCH] Scrollable unit control panel tweak --- client/public/stylesheets/panels/unitcontrol.css | 4 ++++ client/src/panels/unitcontrolpanel.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/client/public/stylesheets/panels/unitcontrol.css b/client/public/stylesheets/panels/unitcontrol.css index 4e659fbd..9b576252 100644 --- a/client/public/stylesheets/panels/unitcontrol.css +++ b/client/public/stylesheets/panels/unitcontrol.css @@ -16,6 +16,10 @@ body.feature-forceShowUnitControlPanel #unit-control-panel { row-gap: 10px; } +#unit-controls { + padding-right: 10px; +} + #unit-control-panel>div:nth-child(2) { width: 330px; } diff --git a/client/src/panels/unitcontrolpanel.ts b/client/src/panels/unitcontrolpanel.ts index 1ec769f6..b317992d 100644 --- a/client/src/panels/unitcontrolpanel.ts +++ b/client/src/panels/unitcontrolpanel.ts @@ -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`; }