Add simple tree style navigation

This commit is contained in:
Tusooa Zhu 2021-08-07 18:53:23 -04:00
parent 8c0deb905e
commit d9a9f97751
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
8 changed files with 113 additions and 20 deletions

View file

@ -97,6 +97,7 @@ const Status = {
'inProfile',
'profileUserId',
'simpleTree',
'controlledThreadDisplayStatus',
'controlledToggleThreadDisplay',
@ -379,10 +380,9 @@ const Status = {
},
toggleThreadDisplay () {
this.controlledToggleThreadDisplay()
}
},
watch: {
'highlight': function (id) {
},
scrollIfHighlighted (highlightId) {
const id = highlightId
if (this.status.id === id) {
let rect = this.$el.getBoundingClientRect()
if (rect.top < 100) {
@ -396,6 +396,14 @@ const Status = {
window.scrollBy(0, rect.bottom - window.innerHeight + 50)
}
}
}
},
mounted () {
this.scrollIfHighlighted(this.highlight)
},
watch: {
'highlight': function (id) {
this.scrollIfHighlighted(id)
},
'status.repeat_num': function (num) {
// refetch repeats when repeat_num is changed in any way