mapcomplete/UI/Base/FixedUiElement.ts

25 lines
500 B
TypeScript
Raw Normal View History

2021-06-12 02:58:32 +02:00
import BaseUIElement from "../BaseUIElement";
2020-06-24 00:35:19 +02:00
2021-06-12 02:58:32 +02:00
export class FixedUiElement extends BaseUIElement {
2020-06-24 00:35:19 +02:00
private _html: string;
constructor(html: string) {
2021-06-12 02:58:32 +02:00
super();
2020-07-20 15:54:50 +02:00
this._html = html ?? "";
2020-06-24 00:35:19 +02:00
}
2020-07-20 18:24:00 +02:00
InnerRender(): string {
2020-06-24 00:35:19 +02:00
return this._html;
}
AsMarkdown(): string {
return this._html;
}
2021-06-12 02:58:32 +02:00
protected InnerConstructElement(): HTMLElement {
const e = document.createElement("span")
e.innerHTML = this._html
return e;
}
2020-06-24 00:35:19 +02:00
}