mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Speedup listChecked().length to hasChecked()
This commit is contained in:
parent
7ec3d70c60
commit
47a861a243
8 changed files with 28 additions and 20 deletions
|
|
@ -216,12 +216,8 @@ export class Selector {
|
|||
});
|
||||
}
|
||||
|
||||
isListChecked() {
|
||||
return this.list.find(item => item.checked());
|
||||
}
|
||||
|
||||
itemSelected(item) {
|
||||
if (this.isListChecked()) {
|
||||
if (this.list.hasChecked()) {
|
||||
item || this.oCallbacks.ItemSelect?.(null);
|
||||
} else if (item) {
|
||||
this.oCallbacks.ItemSelect?.(item);
|
||||
|
|
@ -373,7 +369,7 @@ export class Selector {
|
|||
|
||||
if (result) {
|
||||
this.focusedItem(result);
|
||||
if ((this.autoSelect() || bForceSelect) && !this.isListChecked()) {
|
||||
if ((this.autoSelect() || bForceSelect) && !this.list.hasChecked()) {
|
||||
this.selectedItem(result);
|
||||
}
|
||||
this.scrollToFocused();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue