aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 11e4430f..82de0fd2 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -57,12 +57,13 @@ const Status = {
},
isFocused () {
// retweet or root of an expanded conversation
- if(this.focused)
+ if (this.focused) {
return true
- // use conversation highlight only when in conversation
- else if(!this.inConversation)
+ } else if (!this.inConversation) {
return false
- return this.highlight == this.status.id
+ }
+ // use conversation highlight only when in conversation
+ return this.status.id === this.highlight
}
},
components: {
@@ -100,14 +101,16 @@ const Status = {
}
},
watch: {
- 'highlight': function (newfocus) {
- if(this.status.id == newfocus) {
+ 'highlight': function (id) {
+ id = Number(id)
+ if (this.status.id === id) {
let rect = this.$el.getBoundingClientRect()
- if(rect.top < 100)
+ if (rect.top < 100) {
window.scrollBy(0, rect.top - 200)
- // will be useful when scrolling down to replies or root posts is in
- else if(rect.bottom > window.innerHeight - 100)
+ } else if(rect.bottom > window.innerHeight - 100) {
+ // will be useful when scrolling down to replies or root posts is in
window.scrollBy(0, rect.bottom + 200)
+ }
}
}
}