From 0d6d18e3fa27441e4193f75d3698f212b2b5310a Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 13 Apr 2022 08:34:24 -0600 Subject: [PATCH] Et2Image: Show as clickable if image has href OR onclick --- api/js/etemplate/Et2Image/Et2Image.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/api/js/etemplate/Et2Image/Et2Image.ts b/api/js/etemplate/Et2Image/Et2Image.ts index 508881c62c..e18105c903 100644 --- a/api/js/etemplate/Et2Image/Et2Image.ts +++ b/api/js/etemplate/Et2Image/Et2Image.ts @@ -42,8 +42,7 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM * Added here as there's no Lion parent */ label: { - type: String, - translate: true + type: String }, /** @@ -150,14 +149,14 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM * Handle changes that have to happen based on changes to properties * */ - requestUpdate(name : PropertyKey, oldValue) + updated(changedProperties) { - super.requestUpdate(name, oldValue); + super.updated(changedProperties); - // if there's an href, make it look clickable - if(name == 'href') + // if there's an href or onclick, make it look clickable + if(changedProperties.has("href") || changedProperties.has("onclick")) { - this.classList.toggle("et2_clickable", this.href) + this.classList.toggle("et2_clickable", this.href || this.onclick) } }