mapcomplete/UI/Base/VerticalCombine.ts

20 lines
522 B
TypeScript
Raw Permalink Normal View History

2020-06-29 03:12:44 +02:00
import {UIElement} from "../UIElement";
2020-06-24 00:35:19 +02:00
export class VerticalCombine extends UIElement {
private readonly _elements: UIElement[];
constructor(elements: UIElement[]) {
2020-06-24 00:35:19 +02:00
super(undefined);
this._elements = elements;
}
2020-07-29 15:05:19 +02:00
InnerRender(): string {
2020-06-24 00:35:19 +02:00
let html = "";
for (const element of this._elements) {
if (element !== undefined && !element.IsEmpty()) {
html += "<div>" + element.Render() + "</div>";
2020-06-24 00:35:19 +02:00
}
}
return html;
2020-06-24 00:35:19 +02:00
}
}