Et2LinkList: Do not create context menu until needed

This commit is contained in:
nathan 2024-09-17 08:50:05 -06:00
parent 5efbf26267
commit 6e7a01dde9

View File

@ -116,6 +116,8 @@ export class Et2LinkList extends Et2LinkString
} }
} }
private context : egwMenu;
constructor() constructor()
{ {
super(); super();
@ -130,7 +132,6 @@ export class Et2LinkList extends Et2LinkString
connectedCallback() connectedCallback()
{ {
super.connectedCallback(); super.connectedCallback();
this._createContextMenu();
// Look for LinkTo and listen for change so we can update // Look for LinkTo and listen for change so we can update
if(this.getInstanceManager()) if(this.getInstanceManager())
@ -527,6 +528,11 @@ export class Et2LinkList extends Et2LinkString
{ {
return; return;
} }
if(!this.context)
{
this._createContextMenu();
}
// Find the link // Find the link
let link = this.querySelector("et2-link[slot='" + _ev.currentTarget.id + "']"); let link = this.querySelector("et2-link[slot='" + _ev.currentTarget.id + "']");