aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2021-08-07 18:53:23 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-03-07 19:19:29 -0500
commitd9a9f97751b2f51f55848652e5126700aea0f3fe (patch)
treefcb50e83c15a01879759332a47f91bfbe2a69684 /src/components/status/status.js
parent8c0deb905eb9860430d831d8d215e1eb6910f117 (diff)
Add simple tree style navigation
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index f119f42e..15c2d029 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -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