mapcomplete/UI/Base/FixedUiElement.ts

26 lines
519 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 {
2021-11-30 22:50:48 +01:00
public readonly content: string;
2020-06-24 00:35:19 +02:00
constructor(html: string) {
2021-06-12 02:58:32 +02:00
super();
2021-11-30 22:50:48 +01:00
this.content = html ?? "";
2020-06-24 00:35:19 +02:00
}
2020-07-20 18:24:00 +02:00
InnerRender(): string {
2021-11-30 22:50:48 +01:00
return this.content;
2020-06-24 00:35:19 +02:00
}
AsMarkdown(): string {
2021-11-30 22:50:48 +01:00
return this.content;
}
2021-06-12 02:58:32 +02:00
protected InnerConstructElement(): HTMLElement {
const e = document.createElement("span")
2021-11-30 22:50:48 +01:00
e.innerHTML = this.content
2021-06-12 02:58:32 +02:00
return e;
}
2022-01-18 18:52:42 +01:00
2021-06-12 02:58:32 +02:00
2020-06-24 00:35:19 +02:00
}