click on tree-item now triggers the onclick event --- previous it was only triggered on change of folder

This commit is contained in:
milan 2024-03-28 18:51:56 +01:00
parent 8658e46676
commit 3cc5d910b8

View File

@ -151,7 +151,6 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
// Actions can't be initialized without being connected to InstanceManager
this._initActions();
//TODO do it on first updated
this._link_actions(this.actions)
}
@ -163,6 +162,11 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
//Sl-Trees handle their own onClick events
_handleClick(_ev)
{
//if onclick is defined, and we have a resonable target (e.g. one single item that was clicked on, trigger the onclick function
if (typeof this.onclick == "function" && typeof _ev.target.value == "string")
{
this.onclick(_ev.target.value, this, _ev.target.value)
}
}
static get styles()