mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Cleanup calls to Knockout observableArray
Improved Knockout observableArray
This commit is contained in:
parent
fa5476e486
commit
b6f0b634fb
47 changed files with 251 additions and 276 deletions
|
|
@ -42,7 +42,7 @@ class Selector {
|
|||
) {
|
||||
this.list = koList;
|
||||
|
||||
this.listChecked = ko.computed(() => this.list().filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 });
|
||||
this.isListChecked = ko.computed(() => 0 < this.listChecked().length);
|
||||
|
||||
this.focusedItem = koFocusedItem || ko.observable(null);
|
||||
|
|
@ -329,11 +329,11 @@ class Selector {
|
|||
result = null;
|
||||
|
||||
const pageStep = 10,
|
||||
list = this.list(),
|
||||
listLen = list ? list.length : 0,
|
||||
list = this.list,
|
||||
listLen = list.length,
|
||||
focused = this.focusedItem();
|
||||
|
||||
if (0 < listLen) {
|
||||
if (listLen) {
|
||||
if (focused) {
|
||||
if (isArrow) {
|
||||
let i = list.indexOf(focused);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue