Et2Description: Fix links were not clickable

activateLinks property got typoed to activeLinks in the template conversion
This commit is contained in:
nathan 2023-02-01 14:31:17 -07:00
parent 346a720d27
commit 1fa9d91d59

View File

@ -49,7 +49,7 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
* Scan the value, and if there are any links (URL, mailto:) then wrap them in a clickable * Scan the value, and if there are any links (URL, mailto:) then wrap them in a clickable
* <a/> tag * <a/> tag
*/ */
activeLinks: { activateLinks: {
type: Boolean, type: Boolean,
reflect: true reflect: true
}, },
@ -88,7 +88,7 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
super(); super();
// Initialize properties // Initialize properties
this.activeLinks = false; this.activateLinks = false;
this.extraLinkPopup = ""; this.extraLinkPopup = "";
this.extraLinkTarget = "_browser"; this.extraLinkTarget = "_browser";
// Don't initialize this to avoid href(unknown) when rendered // Don't initialize this to avoid href(unknown) when rendered
@ -148,7 +148,7 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
super.requestUpdate(...arguments); super.requestUpdate(...arguments);
// Due to how we do the rendering into the light DOM (not sure it's right) we need this after // Due to how we do the rendering into the light DOM (not sure it's right) we need this after
// value change or it won't actually show up // value change or it won't actually show up
if(["value", "href", "activeLinks"].indexOf(attribute) != -1 && this.parentNode) if(["value", "href", "activateLinks"].indexOf(attribute) != -1 && this.parentNode)
{ {
this.updateComplete.then(() => render(this._renderContent(), <HTMLElement><unknown>this)); this.updateComplete.then(() => render(this._renderContent(), <HTMLElement><unknown>this));
} }
@ -171,7 +171,7 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
render = this.wrapLink(this.href, this.value); render = this.wrapLink(this.href, this.value);
} }
// If we want to activate links inside, do that // If we want to activate links inside, do that
else if(this.activeLinks && this.value) else if(this.activateLinks && this.value)
{ {
render = this.getActivatedValue(this.value, this.href ? this.extraLinkTarget : '_blank'); render = this.getActivatedValue(this.value, this.href ? this.extraLinkTarget : '_blank');
} }