Fix HFilter find functions
This commit is contained in:
parent
592a9fe8e7
commit
54b5f7b8f2
1
TODO.md
1
TODO.md
|
@ -3,6 +3,7 @@
|
|||
- add account number binds
|
||||
- rename goto*account → scrollto*account
|
||||
|
||||
- fix up/down type error when filtering
|
||||
- fix opacity
|
||||
- fix python error
|
||||
- fix back/front buttons in small window
|
||||
|
|
|
@ -34,17 +34,17 @@ DelegateModel {
|
|||
for (let i = 0; i < items.count; i++) refilterAt(i)
|
||||
}
|
||||
|
||||
function filteredFindIndex(id) {
|
||||
function filteredFindIndex(id, default_=null) {
|
||||
for (let i = 0; i < filtered.count; i++)
|
||||
if (filtered.get(i).id === id) return i
|
||||
|
||||
return null
|
||||
return default_
|
||||
}
|
||||
|
||||
function filteredFind(id) {
|
||||
function filteredFind(id, default_=null) {
|
||||
for (let i = 0; i < filtered.count; i++)
|
||||
if (filtered.get(i).id === id) return get(i)
|
||||
|
||||
return null
|
||||
return default_
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ HColumnLayout {
|
|||
currentIndex:
|
||||
roomList.currentIndex === -1 ?
|
||||
-1 :
|
||||
model.findIndex(
|
||||
model.filteredFindIndex(
|
||||
roomList.model.filtered.get(
|
||||
roomList.currentIndex,
|
||||
).model.for_account,
|
||||
|
|
Loading…
Reference in New Issue
Block a user