mapcomplete/UI/VerticalCombine.ts
2020-06-25 03:39:31 +02:00

32 lines
No EOL
762 B
TypeScript

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();
}
}
Activate() {
for (const element of this._elements){
element.Activate();
}
}
}