You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
643 B
JavaScript

class RowColWidget extends Widget {
#children;
constructor(data, renderer) {
super(data, renderer);
this.#children = [];
this.renderer._makeWidgets(this.#children, data.type, data.data);
}
build() {
const $root = document.createElement('div');
$root.classList.add('widget_' + this.data.type);
$root.style.width = this.data.wwidth_t + '%';
for (const w of this.#children) {
const $w = w.build();
if ($w) $root.append($w);
}
return $root;
}
}
Renderer.register('row', RowColWidget);
Renderer.register('col', RowColWidget);