mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 01:29:05 +01:00
Et2Link: Wait for link title before we say update is complete
Overriding _getUpdateComplete() lets us wait for whatever conditions we want, so we can wait on the Promise from link_title()
This commit is contained in:
parent
3a476dcbd6
commit
846852ca22
@ -154,6 +154,16 @@ export class Et2Link extends ExposeMixin<Et2Widget>(Et2Widget(LitElement)) imple
|
||||
super.connectedCallback();
|
||||
}
|
||||
|
||||
async _getUpdateComplete()
|
||||
{
|
||||
await super._getUpdateComplete();
|
||||
if(this._titlePromise)
|
||||
{
|
||||
// Wait for the title to arrive before we say we're done
|
||||
await this._titlePromise;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a thumbnail for the link
|
||||
* @param link
|
||||
@ -371,7 +381,10 @@ export class Et2Link extends ExposeMixin<Et2Widget>(Et2Widget(LitElement)) imple
|
||||
let url = _data.download_url;
|
||||
|
||||
// NEED an absolute URL
|
||||
if (url[0] == '/') url = egw.link(url);
|
||||
if(url[0] == '/')
|
||||
{
|
||||
url = this.egw().link(url);
|
||||
}
|
||||
// egw.link adds the webserver, but that might not be an absolute URL - try again
|
||||
if (url[0] == '/') url = window.location.origin + url;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user