mapcomplete/UI/FullScreenMessageBoxHandler.ts

31 lines
806 B
TypeScript
Raw Normal View History

import {UIElement} from "./UIElement";
import State from "../State";
import Combine from "./Base/Combine";
/**
* Handles the full screen popup on mobile
*/
export default class FullScreenMessageBox extends UIElement {
2020-11-15 14:56:20 +01:00
private _content: UIElement;
2021-01-07 04:50:12 +01:00
constructor() {
2020-11-16 01:59:30 +01:00
super(State.state.fullScreenMessage);
this.HideOnEmpty(true);
}
2020-06-29 03:12:44 +02:00
InnerRender(): string {
2020-09-12 23:15:17 +02:00
if (State.state.fullScreenMessage.data === undefined) {
return "";
}
2021-01-08 18:02:07 +01:00
this._content = State.state.fullScreenMessage.data.content;
return new Combine([this._content]).SetClass("block max-h-screen h-screen overflow-x-hidden overflow-y-auto bg-white p-2").Render();
}
protected InnerUpdate(htmlElement: HTMLElement) {
super.InnerUpdate(htmlElement);
}
}