Skip to content

Commit 988039e

Browse files
committed
dev: src prop for images
1 parent 25e9ed8 commit 988039e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/gui/src/UI/UIElement.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ export default def(class UIElement extends AdvancedBase {
5656
if ( attrs.text ) {
5757
el.innerText = attrs.text;
5858
}
59-
if ( attrs.style ) {
60-
el.setAttribute('style', attrs.style);
61-
}
59+
;['style', 'src'].forEach(attrprop => {
60+
if ( ! attrs.hasOwnProperty(attrprop) ) return;
61+
el.setAttribute(attrprop, attrs[attrprop]);
62+
})
6263
return el;
6364
};
6465
// === END :: Helpful convenient library ===

0 commit comments

Comments
 (0)