mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-27 05:11:41 +02: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
7d43ec0449
commit
e9b66d0988
@ -445,15 +445,17 @@ export const Et2WithSearchMixin = dedupeMixin(<T extends Constructor<LitElement>
|
|||||||
|
|
||||||
protected async _moreResultsTemplate()
|
protected async _moreResultsTemplate()
|
||||||
{
|
{
|
||||||
await this.updateComplete;
|
if(this._total_result_count <= 0 || !this.select || !this._searchPromise)
|
||||||
const moreCount = this._total_result_count - this.select?.querySelectorAll("sl-option.match").length;
|
|
||||||
if(this._total_result_count <= 0 || moreCount == 0 || !this.select)
|
|
||||||
{
|
{
|
||||||
return nothing;
|
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()
|
protected _searchInputTemplate()
|
||||||
|
@ -112,7 +112,7 @@ class Link extends Etemplate\Widget
|
|||||||
|
|
||||||
$response = Api\Json\Response::get();
|
$response = Api\Json\Response::get();
|
||||||
// convert associative array to a real array with value attribute, to preserve the order of numeric keys
|
// 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))
|
if (is_array($value))
|
||||||
{
|
{
|
||||||
@ -122,7 +122,12 @@ class Link extends Etemplate\Widget
|
|||||||
'value' => $key,
|
'value' => $key,
|
||||||
'label' => $value,
|
'label' => $value,
|
||||||
];
|
];
|
||||||
}, array_keys($links), $links)));
|
}, array_keys($links), $links));
|
||||||
|
if(array_key_exists('total', $options))
|
||||||
|
{
|
||||||
|
$result['total'] = $options['total'];
|
||||||
|
}
|
||||||
|
$response->data($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user