forked from AkkomaGang/akkoma-fe
lint fixes
This commit is contained in:
parent
3f477986cf
commit
c989170321
2 changed files with 15 additions and 12 deletions
|
@ -8,7 +8,7 @@ const sortAndFilterConversation = (conversation) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const conversation = {
|
const conversation = {
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
highlight: this.statusoid.id
|
highlight: this.statusoid.id
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,8 @@ const conversation = {
|
||||||
return (id === this.statusoid.id)
|
return (id === this.statusoid.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setHighlight(id) {
|
setHighlight (id) {
|
||||||
this.highlight = id
|
this.highlight = Number(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,12 +57,13 @@ const Status = {
|
||||||
},
|
},
|
||||||
isFocused () {
|
isFocused () {
|
||||||
// retweet or root of an expanded conversation
|
// retweet or root of an expanded conversation
|
||||||
if(this.focused)
|
if (this.focused) {
|
||||||
return true
|
return true
|
||||||
// use conversation highlight only when in conversation
|
} else if (!this.inConversation) {
|
||||||
else if(!this.inConversation)
|
|
||||||
return false
|
return false
|
||||||
return this.highlight == this.status.id
|
}
|
||||||
|
// use conversation highlight only when in conversation
|
||||||
|
return this.status.id === this.highlight
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -100,14 +101,16 @@ const Status = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'highlight': function (newfocus) {
|
'highlight': function (id) {
|
||||||
if(this.status.id == newfocus) {
|
id = Number(id)
|
||||||
|
if (this.status.id === id) {
|
||||||
let rect = this.$el.getBoundingClientRect()
|
let rect = this.$el.getBoundingClientRect()
|
||||||
if(rect.top < 100)
|
if (rect.top < 100) {
|
||||||
window.scrollBy(0, rect.top - 200)
|
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)
|
window.scrollBy(0, rect.bottom + 200)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue