Css tweaks

This commit is contained in:
Pieter Vander Vennet 2021-01-07 04:50:12 +01:00
parent 489c6fc3c0
commit 701ce3e89a
23 changed files with 1220 additions and 114 deletions

View file

@ -1,5 +1,4 @@
import {UIElement} from "./UIElement";
import Translations from "./i18n/Translations";
import State from "../State";
import Combine from "./Base/Combine";
@ -8,24 +7,11 @@ import Combine from "./Base/Combine";
*/
export default class FullScreenMessageBox extends UIElement {
private readonly returnToTheMap: UIElement;
private _content: UIElement;
constructor(onClear: (() => void)) {
constructor() {
super(State.state.fullScreenMessage);
this.HideOnEmpty(true);
this.returnToTheMap =
new Combine([
// Wrapped another time to prevent the value of 'em' to fluctuate
Translations.t.general.returnToTheMap.Clone()
])
.onClick(() => {
State.state.fullScreenMessage.setData(undefined);
onClear();
})
.SetClass("to-the-map")
}
@ -34,17 +20,14 @@ export default class FullScreenMessageBox extends UIElement {
return "";
}
this._content = State.state.fullScreenMessage.data;
const innerWrap = new Combine([this._content]).SetClass("fullscreenmessage-content")
return new Combine([innerWrap, this.returnToTheMap])
.SetStyle("display:block; height: 100%;")
.Render();
return new Combine([this._content]).SetClass("fullscreenmessage-content").Render();
}
protected InnerUpdate(htmlElement: HTMLElement) {
super.InnerUpdate(htmlElement);
// This is a bit out of place, and it is a fix specifically for the featureinfobox-titlebar
const height = htmlElement.getElementsByClassName("featureinfobox-titlebar")[0]?.clientHeight ?? 0;
htmlElement.style.setProperty("--variable-title-height", height+"px")
htmlElement.style.setProperty("--variable-title-height", height + "px")
}