mapcomplete/UI/VerticalCombine.ts

32 lines
762 B
TypeScript
Raw Normal View History

2020-06-24 00:35:19 +02:00
import {UIElement} from "./UIElement";
export class VerticalCombine extends UIElement {
private _elements: UIElement[];
constructor(elements: UIElement[]) {
super(undefined);
this._elements = elements;
}
protected InnerRender(): string {
let html = "";
for (const element of this._elements){
if (!element.IsEmpty()) {
html += "<div>" + element.Render() + "</div><br />";
}
}
return html;
}
InnerUpdate(htmlElement: HTMLElement) {
for (const element of this._elements){
element.Update();
}
2020-06-24 00:35:19 +02:00
}
Activate() {
for (const element of this._elements){
element.Activate();
}
}
}