mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
- Send total results with link search results
- Change how "# More" is shown to wait for all searches first
This commit is contained in:
parent
76533722d1
commit
cfc7efde15
@ -445,15 +445,17 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
||||
|
||||
protected async _moreResultsTemplate()
|
||||
{
|
||||
await this.updateComplete;
|
||||
const moreCount = this._total_result_count - this.select?.querySelectorAll("sl-option.match").length;
|
||||
if(this._total_result_count <= 0 || moreCount == 0 || !this.select)
|
||||
if(this._total_result_count <= 0 || !this.select || !this._searchPromise)
|
||||
{
|
||||
return nothing;
|
||||
}
|
||||
const more = this.egw().lang("%1 more...", moreCount);
|
||||
return this._searchPromise.then(() =>
|
||||
{
|
||||
const moreCount = this._total_result_count - this.select?.querySelectorAll("sl-option.match").length;
|
||||
const more = this.egw().lang("%1 more...", moreCount);
|
||||
|
||||
return html`<span class="more">${more}</span>`;
|
||||
return html`<span class="more">${more}</span>`;
|
||||
});
|
||||
}
|
||||
|
||||
protected _searchInputTemplate()
|
||||
|
@ -112,7 +112,7 @@ class Link extends Etemplate\Widget
|
||||
|
||||
$response = Api\Json\Response::get();
|
||||
// convert associative array to a real array with value attribute, to preserve the order of numeric keys
|
||||
$response->data(array_values(array_map(static function($key, $value)
|
||||
$result = array_values(array_map(static function ($key, $value)
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
@ -122,7 +122,12 @@ class Link extends Etemplate\Widget
|
||||
'value' => $key,
|
||||
'label' => $value,
|
||||
];
|
||||
}, array_keys($links), $links)));
|
||||
}, array_keys($links), $links));
|
||||
if(array_key_exists('total', $options))
|
||||
{
|
||||
$result['total'] = $options['total'];
|
||||
}
|
||||
$response->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user