diff options
| author | Shpuld Shpuldson <shpuld@gmail.com> | 2017-04-21 19:15:54 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shpuld@gmail.com> | 2017-04-21 19:15:54 +0300 |
| commit | c2db700544a3aae58b27c52eaf6cf3b47a2bcff4 (patch) | |
| tree | 4af4d286740c072250b791aebfcadc0a3bb526ff /src/components/status/status.js | |
| parent | 36655002d062183a577f5b8fd66628d56670ec1f (diff) | |
| parent | 1f8d30386388f8b91aa84fdbd7861e588aa0d935 (diff) | |
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma-fe into feature/hash-routed
Diffstat (limited to 'src/components/status/status.js')
| -rw-r--r-- | src/components/status/status.js | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index bb026fe1..5e7bde53 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -11,7 +11,8 @@ const Status = { 'statusoid', 'expandable', 'inConversation', - 'focused' + 'focused', + 'highlight' ], data: () => ({ replying: false, @@ -53,6 +54,16 @@ const Status = { return { borderBottomColor: this.$store.state.config.colors['base02'] } + }, + isFocused () { + // retweet or root of an expanded conversation + if (this.focused) { + return true + } else if (!this.inConversation) { + return false + } + // use conversation highlight only when in conversation + return this.status.id === this.highlight } }, components: { @@ -75,6 +86,10 @@ const Status = { toggleReplying () { this.replying = !this.replying }, + gotoOriginal () { + // only handled by conversation, not status_or_conversation + this.$emit('goto', this.status.in_reply_to_status_id) + }, toggleExpanded () { this.$emit('toggleExpanded') }, @@ -84,6 +99,20 @@ const Status = { toggleUserExpanded () { this.userExpanded = !this.userExpanded } + }, + watch: { + 'highlight': function (id) { + id = Number(id) + if (this.status.id === id) { + 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) + } + } + } } } |
