mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-21 22:22:15 +01:00
Api: Fix doubled link on open and missing link app select
This commit is contained in:
parent
a89b69528e
commit
b44ea1b2b0
@ -284,7 +284,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE
|
||||
protected _handleEntrySelect(event)
|
||||
{
|
||||
event.stopPropagation();
|
||||
this.classList.add("hideApp");
|
||||
this.classList.toggle("hideApp", Boolean(typeof this.value == "object" ? this.value?.id : this.value));
|
||||
this.dispatchEvent(new Event("change"));
|
||||
this.requestUpdate('value');
|
||||
|
||||
@ -390,10 +390,7 @@ export class Et2LinkEntry extends Et2InputWidget(FormControlMixin(SlotMixin(LitE
|
||||
this.app = value.app;
|
||||
this._searchNode.value = value.id;
|
||||
}
|
||||
if(value.id)
|
||||
{
|
||||
this.classList.add("hideApp");
|
||||
}
|
||||
this.classList.toggle("hideApp", Boolean(value.id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,7 +300,17 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache
|
||||
this._loadingPromise = <Promise<LinkInfo[]>>(this.egw().jsonq('EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_list', [_value]))
|
||||
.then(_value =>
|
||||
{
|
||||
this._addLinks(not_saved_links.concat(_value));
|
||||
if(_value && Array.isArray(_value))
|
||||
{
|
||||
for(let link of <LinkInfo[]>_value)
|
||||
{
|
||||
if(!not_saved_links.some(l => l.app == link.app && l.id == link.id))
|
||||
{
|
||||
not_saved_links.push(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._addLinks(not_saved_links);
|
||||
this._loadingPromise = null;
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user