mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2024-11-12 19:44:53 +00:00
Highlight ancestor of the current status when diving back to top
This commit is contained in:
parent
d78c8e8ea4
commit
f1db5e8f4b
1 changed files with 10 additions and 1 deletions
|
@ -441,7 +441,7 @@ const conversation = {
|
|||
this.tryScrollTo(id)
|
||||
},
|
||||
diveToTopLevel () {
|
||||
this.tryScrollTo(this.topLevel[0].id)
|
||||
this.tryScrollTo(this.topLevelAncestorOrSelfId(this.diveRoot) || this.topLevel[0].id)
|
||||
},
|
||||
// only used when we are not on a page
|
||||
undive () {
|
||||
|
@ -490,6 +490,15 @@ const conversation = {
|
|||
}
|
||||
// console.log('ancestors = ', ancestors, 'conversation = ', this.conversation.map(k => k.id), 'statusContentProperties=', this.statusContentProperties)
|
||||
return ancestors
|
||||
},
|
||||
topLevelAncestorOrSelfId (id) {
|
||||
let cur = id
|
||||
let parent = this.parentOf(id)
|
||||
while (parent) {
|
||||
cur = this.parentOf(cur)
|
||||
parent = this.parentOf(parent)
|
||||
}
|
||||
return cur
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue