From bd555ec4d1cffc82f9da90735115cf8eae27f4b2 Mon Sep 17 00:00:00 2001 From: ralf Date: Wed, 3 Aug 2022 16:27:23 +0200 Subject: [PATCH] fix JS error, if we have no image and no _iconNode --- api/js/etemplate/Et2Button/Et2Button.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Button/Et2Button.ts b/api/js/etemplate/Et2Button/Et2Button.ts index 12b97b40c7..00ae8d2d9c 100644 --- a/api/js/etemplate/Et2Button/Et2Button.ts +++ b/api/js/etemplate/Et2Button/Et2Button.ts @@ -283,8 +283,12 @@ export class Et2Button extends Et2InputWidget(SlButton) const image = document.createElement("et2-image"); image.slot = "prefix"; this.prepend(image); + image.src = this.__image; + } + else if (this._iconNode) + { + this._iconNode.src = this.__image; } - this._iconNode.src = this.__image; } }