From 4fabeda3ecbd0f194f3951a2394849de504b1a89 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Sun, 4 Jun 2017 23:58:15 +0300 Subject: Add list of replies under the name/links in conversation statuses, clicking them will highlight the statuses and scroll you to them, expanding a status will scroll you to that status once the conversation has opened. --- src/components/status/status.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/components/status/status.js') diff --git a/src/components/status/status.js b/src/components/status/status.js index 183838a8..7b8f304b 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -13,7 +13,8 @@ const Status = { 'inConversation', 'focused', 'highlight', - 'compact' + 'compact', + 'replies' ], data: () => ({ replying: false, @@ -87,12 +88,14 @@ 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', this.status.in_reply_to_status_id) + this.$emit('goto', id) }, toggleExpanded () { this.$emit('toggleExpanded') + //console.log(this.replies) }, toggleMute () { this.unmuted = !this.unmuted @@ -108,9 +111,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) } } } -- cgit v1.2.3-70-g09d2