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.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 5e7bde53..4f5093e1 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -12,7 +12,9 @@ const Status = {
'expandable',
'inConversation',
'focused',
- 'highlight'
+ 'highlight',
+ 'compact',
+ 'replies'
],
data: () => ({
replying: false,
@@ -86,9 +88,9 @@ const Status = {
toggleReplying () {
this.replying = !this.replying
},
- gotoOriginal () {
+ gotoOriginal (id) {
// only handled by conversation, not status_or_conversation
- this.$emit('goto', this.status.in_reply_to_status_id)
+ this.$emit('goto', id)
},
toggleExpanded () {
this.$emit('toggleExpanded')
@@ -98,6 +100,15 @@ const Status = {
},
toggleUserExpanded () {
this.userExpanded = !this.userExpanded
+ },
+ replyEnter (id, event) {
+ if (this.$store.state.config.hoverPreview) {
+ let rect = event.target.getBoundingClientRect()
+ this.$emit('preview', Number(id), rect.left + 20, rect.top + 20 + window.pageYOffset)
+ }
+ },
+ replyLeave () {
+ this.$emit('preview', 0, 0, 0)
}
},
watch: {
@@ -107,9 +118,8 @@ const Status = {
let rect = this.$el.getBoundingClientRect()
if (rect.top < 100) {
window.scrollBy(0, rect.top - 200)
- } 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)
+ } else if (rect.bottom > window.innerHeight - 50) {
+ window.scrollBy(0, rect.bottom - window.innerHeight + 50)
}
}
}