2020-06-27 03:06:51 +02:00
|
|
|
import {UIElement} from "./UIElement";
|
2020-10-02 19:00:24 +02:00
|
|
|
import State from "../State";
|
2020-09-03 16:44:48 +02:00
|
|
|
import Combine from "./Base/Combine";
|
2020-06-27 03:06:51 +02:00
|
|
|
|
2020-07-21 02:55:28 +02:00
|
|
|
/**
|
|
|
|
* Handles the full screen popup on mobile
|
|
|
|
*/
|
2021-01-04 04:06:21 +01:00
|
|
|
export default class FullScreenMessageBox extends UIElement {
|
2020-07-31 01:45:54 +02:00
|
|
|
|
2020-11-15 14:56:20 +01:00
|
|
|
private _content: UIElement;
|
2020-06-27 03:06:51 +02:00
|
|
|
|
2021-01-07 04:50:12 +01:00
|
|
|
constructor() {
|
2020-11-16 01:59:30 +01:00
|
|
|
super(State.state.fullScreenMessage);
|
2020-09-03 16:44:48 +02:00
|
|
|
this.HideOnEmpty(true);
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|
|
|
|
|
2020-06-29 03:12:44 +02:00
|
|
|
|
2020-09-03 16:44:48 +02:00
|
|
|
InnerRender(): string {
|
2020-09-12 23:15:17 +02:00
|
|
|
if (State.state.fullScreenMessage.data === undefined) {
|
2020-09-03 16:44:48 +02:00
|
|
|
return "";
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|
2021-01-08 18:02:07 +01:00
|
|
|
this._content = State.state.fullScreenMessage.data.content;
|
2021-01-07 04:50:12 +01:00
|
|
|
return new Combine([this._content]).SetClass("fullscreenmessage-content").Render();
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|
|
|
|
|
2020-11-23 02:55:18 +01:00
|
|
|
protected InnerUpdate(htmlElement: HTMLElement) {
|
|
|
|
super.InnerUpdate(htmlElement);
|
2021-01-07 04:50:12 +01:00
|
|
|
// This is a bit out of place, and it is a fix specifically for the featureinfobox-titlebar
|
2020-11-23 02:55:18 +01:00
|
|
|
const height = htmlElement.getElementsByClassName("featureinfobox-titlebar")[0]?.clientHeight ?? 0;
|
2021-01-07 04:50:12 +01:00
|
|
|
htmlElement.style.setProperty("--variable-title-height", height + "px")
|
2020-11-23 02:55:18 +01:00
|
|
|
}
|
|
|
|
|
2020-09-03 16:44:48 +02:00
|
|
|
|
2020-06-27 03:06:51 +02:00
|
|
|
}
|