Et2Image: Show as clickable if image has href OR onclick

This commit is contained in:
nathan 2022-04-13 08:34:24 -06:00
parent 0f362f9717
commit 0d6d18e3fa

View File

@ -42,8 +42,7 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM
* Added here as there's no Lion parent * Added here as there's no Lion parent
*/ */
label: { label: {
type: String, type: String
translate: true
}, },
/** /**
@ -150,14 +149,14 @@ export class Et2Image extends Et2Widget(LitElement) implements et2_IDetachedDOM
* Handle changes that have to happen based on changes to properties * 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 there's an href or onclick, make it look clickable
if(name == 'href') if(changedProperties.has("href") || changedProperties.has("onclick"))
{ {
this.classList.toggle("et2_clickable", this.href) this.classList.toggle("et2_clickable", this.href || this.onclick)
} }
} }