forked from MapComplete/MapComplete
Cleanup of empty classes, partial use of default export
This commit is contained in:
parent
cc75f5c4fd
commit
9970c4b8bb
55 changed files with 939 additions and 206 deletions
|
@ -1,28 +1,20 @@
|
|||
import {UIElement} from "../UIElement";
|
||||
|
||||
export class VerticalCombine extends UIElement {
|
||||
private _elements: UIElement[];
|
||||
private _className: string;
|
||||
private readonly _elements: UIElement[];
|
||||
|
||||
constructor(elements: UIElement[], className: string = undefined) {
|
||||
constructor(elements: UIElement[]) {
|
||||
super(undefined);
|
||||
this._elements = elements;
|
||||
this._className = className;
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
let html = "";
|
||||
for (const element of this._elements) {
|
||||
if (element!== undefined && !element.IsEmpty()) {
|
||||
if (element !== undefined && !element.IsEmpty()) {
|
||||
html += "<div>" + element.Render() + "</div>";
|
||||
}
|
||||
}
|
||||
if(html === ""){
|
||||
return "";
|
||||
}
|
||||
if (this._className === undefined) {
|
||||
return html;
|
||||
}
|
||||
return "<div class='"+this._className+"'>" + html + "</div>";
|
||||
return html;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue