Skip to content

Commit 25e9ed8

Browse files
committed
dev: make el() yet more convenient
1 parent 5965ab5 commit 25e9ed8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/gui/src/UI/UIElement.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ export default def(class UIElement extends AdvancedBase {
4040

4141
const attrs = {};
4242
for ( const a_or_c of a ) {
43-
if ( Array.isArray(a_or_c) ) {
43+
if ( typeof a_or_c === 'string' ) {
44+
el.innerText += a_or_c;
45+
}
46+
else if ( a_or_c instanceof HTMLElement ) {
47+
el.appendChild(a_or_c);
48+
} if ( Array.isArray(a_or_c) ) {
4449
for ( const child of a_or_c ) {
4550
el.appendChild(child);
4651
}

0 commit comments

Comments
 (0)