From f88fa76866952b1bf1032df7b40edd89e841aea3 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 26 Sep 2024 15:21:31 +0200 Subject: [PATCH] fix class on et2-image was lost --- api/js/etemplate/Et2Image/Et2Image.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Image/Et2Image.ts b/api/js/etemplate/Et2Image/Et2Image.ts index d519aadc63..1a98355ba8 100644 --- a/api/js/etemplate/Et2Image/Et2Image.ts +++ b/api/js/etemplate/Et2Image/Et2Image.ts @@ -167,13 +167,15 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM // set title on et2-image for both bootstrap-image via css-class and embedded img tag this.title = this.statustext || this.label || ""; + this.classList.forEach(_class => { + if (_class.startsWith('bi-')) this.classList.remove(_class); + }); const bootstrap = url.match(/\/node_modules\/bootstrap-icons\/icons\/([^.]+)\.svg/); if (bootstrap) { - this.className = 'bi-'+bootstrap[1]; + this.classList.add('bi-'+bootstrap[1]); return html``; } - this.className = ''; return html`