From 988039eade39ae7762a87a01090ab56f20f4afb1 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Wed, 23 Oct 2024 22:59:18 -0400 Subject: [PATCH] dev: src prop for images --- src/gui/src/UI/UIElement.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/src/UI/UIElement.js b/src/gui/src/UI/UIElement.js index e376bb86..3a8b381d 100644 --- a/src/gui/src/UI/UIElement.js +++ b/src/gui/src/UI/UIElement.js @@ -56,9 +56,10 @@ export default def(class UIElement extends AdvancedBase { if ( attrs.text ) { el.innerText = attrs.text; } - if ( attrs.style ) { - el.setAttribute('style', attrs.style); - } + ;['style', 'src'].forEach(attrprop => { + if ( ! attrs.hasOwnProperty(attrprop) ) return; + el.setAttribute(attrprop, attrs[attrprop]); + }) return el; }; // === END :: Helpful convenient library ===