From 2208ba1b99bb4254b302f82a7146e066a23f9d95 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 19 Aug 2024 13:14:24 -0600 Subject: [PATCH] Et2ButtonIcon: Keep set image property so we can check it --- api/js/etemplate/Et2Button/Et2ButtonIcon.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Button/Et2ButtonIcon.ts b/api/js/etemplate/Et2Button/Et2ButtonIcon.ts index e942563797..435448f7d2 100644 --- a/api/js/etemplate/Et2Button/Et2ButtonIcon.ts +++ b/api/js/etemplate/Et2Button/Et2ButtonIcon.ts @@ -32,9 +32,11 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton)) ]; } + private __image; + set image(new_image : string) { - let oldValue = this.__src; + let oldValue = this.__image; if(new_image.indexOf("http") >= 0 || new_image.indexOf(this.egw().webserverUrl) >= 0) { this.src = new_image @@ -43,6 +45,7 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton)) { this.src = this.egw().image(new_image); } + this.__image = new_image; // For some reason setting it directly does not show the image this.updateComplete.then(() => @@ -63,7 +66,7 @@ export class Et2ButtonIcon extends ButtonMixin(Et2InputWidget(SlIconButton)) get image() { - return this.src || this.name; + return this.__image || this.name; } }