mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Better support single/multiple UI updates
This commit is contained in:
parent
eedd4a52dd
commit
7c9b3dd9e8
@ -493,6 +493,22 @@ export class Et2VfsSelectDialog
|
||||
this.searchResultSelected();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles a search result's selected state
|
||||
*/
|
||||
protected toggleResultSelection(result : HTMLElement & SearchResultElement, force? : boolean)
|
||||
{
|
||||
if(!this.multiple)
|
||||
{
|
||||
this._resultNodes.forEach(n =>
|
||||
{
|
||||
n.selected = false;
|
||||
n.requestUpdate("selected");
|
||||
});
|
||||
}
|
||||
super.toggleResultSelection(result, force);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method must be called whenever the selection changes. It will update the selected file cache, the current
|
||||
* value, and the display value
|
||||
|
@ -174,6 +174,8 @@ type Constructor<T = {}> = new (...args : any[]) => T;
|
||||
* @param {T} superClass
|
||||
* @returns {Constructor<SearchMixinInterface<DataType, Results>> & T}
|
||||
* @constructor
|
||||
*
|
||||
* @event et2-select - Emitted when the selection changes
|
||||
*/
|
||||
export const SearchMixin = <T extends Constructor<Et2InputWidgetInterface &
|
||||
{ egw() : IegwAppLocal, noLang : boolean } & LitElement>,
|
||||
@ -464,7 +466,7 @@ export const SearchMixin = <T extends Constructor<Et2InputWidgetInterface &
|
||||
/**
|
||||
* Toggles a search result's selected state
|
||||
*/
|
||||
private toggleResultSelection(result : HTMLElement & SearchResultElement, force? : boolean)
|
||||
protected toggleResultSelection(result : HTMLElement & SearchResultElement, force? : boolean)
|
||||
{
|
||||
if(force === true || force === false)
|
||||
{
|
||||
@ -503,6 +505,11 @@ export const SearchMixin = <T extends Constructor<Et2InputWidgetInterface &
|
||||
this.value = [this.selectedResults[0]?.value] ?? [];
|
||||
}
|
||||
*/
|
||||
|
||||
this.updateComplete.then(() =>
|
||||
{
|
||||
this.dispatchEvent(new Event("et2-select"));
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user