- Detached widgets still need a loadingFinished() for if they are children of legacy widgets

- Add description click handler
This commit is contained in:
nathan 2021-12-21 10:52:39 -07:00
parent 602ac44c15
commit 5bdf12f1b9
2 changed files with 5 additions and 13 deletions

View File

@ -82,11 +82,6 @@ export class Et2DateReadonly extends Et2Widget(LitElement) implements et2_IDetac
{ {
// nope // nope
} }
loadingFinished()
{
// already done, I'm a wc with no children
}
} }
// @ts-ignore TypeScript is not recognizing that this widget is a LitElement // @ts-ignore TypeScript is not recognizing that this widget is a LitElement

View File

@ -79,6 +79,8 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
this.extra_link_target = "_browser"; this.extra_link_target = "_browser";
this.href = ""; this.href = "";
this.value = ""; this.value = "";
this._handleClick = this._handleClick.bind(this);
} }
set_value(value) set_value(value)
@ -101,7 +103,7 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
} }
// Do we do this here, or in transformAttributes()? // Do we do this here, or in transformAttributes()?
if(!this.no_lang) if(_value && !this.no_lang)
{ {
_value = this.egw().lang(_value); _value = this.egw().lang(_value);
} }
@ -146,11 +148,11 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
async firstUpdated() async firstUpdated()
{ {
this.removeEventListener('click.extra_link'); this.removeEventListener('click.extra_link', this._handleClick);
if(this.extra_link_popup || this.mime) if(this.extra_link_popup || this.mime)
{ {
// Add click listener // Add click listener
this.addEventListener('click.extra_link', this._handleClick.bind(this)); this.addEventListener('click.extra_link', this._handleClick);
} }
} }
@ -207,11 +209,6 @@ export class Et2Description extends Et2Widget(LitElement) implements et2_IDetach
{ {
// nope // nope
} }
loadingFinished()
{
// already done, I'm a wc with no children
}
} }
// @ts-ignore TypeScript is not recognizing that this widget is a LitElement // @ts-ignore TypeScript is not recognizing that this widget is a LitElement