From f915ae174d3454ade20b9f6c827ce84b04ad7089 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 7 Jun 2017 17:58:24 +0300 Subject: Add floating status-previews on reply-link mouseover in conversations and make them optional in the settings, fix a small visual inconsistency in muted statuses while editing the file already.. --- src/components/conversation/conversation.js | 17 ++++++++++++- src/components/conversation/conversation.vue | 38 +++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) (limited to 'src/components/conversation') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 3e601c3d..c91e4fde 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -10,7 +10,12 @@ const sortAndFilterConversation = (conversation) => { const conversation = { data () { return { - highlight: null + highlight: null, + preview: { + x: 0, + y: 0, + status + } } }, props: [ @@ -76,6 +81,16 @@ const conversation = { }, setHighlight (id) { this.highlight = Number(id) + }, + setPreview (id, x, y) { + if (id) { + this.preview.x = x + this.preview.y = y + this.preview.status = filter(this.conversation, { id: id })[0] + console.log(this.preview.status) + } else { + this.preview.status = null + } } } } diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 96e8a5d7..e8d97f99 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -8,7 +8,17 @@
- + +
+
+
+ +
+

+ {{ preview.status.user.name }} + {{ preview.status.user.screen_name}} +

+
@@ -21,4 +31,30 @@ border-bottom-style: solid; border-bottom-width: 1px; } + + .status-preview { + position: absolute; + max-width: 35em; + padding: 0.5em; + display: flex; + border-color: inherit; + border-style: solid; + border-width: 1px; + border-radius: 4px; + box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5); + .avatar { + width: 32px; + height: 32px; + border-radius: 50%; + } + .text { + h4 { + margin-bottom: 0.4em; + small { + font-weight: lighter; + } + } + padding: 0 0.5em 0.5em 0.5em; + } + } -- cgit v1.2.3-70-g09d2 From dcd7d52eb57e52474fa579b5338e2a4ca3e52784 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 7 Jun 2017 18:13:24 +0300 Subject: lint fix --- src/components/conversation/conversation.js | 2 +- src/components/status/status.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/conversation') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index c91e4fde..b781e40c 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -14,7 +14,7 @@ const conversation = { preview: { x: 0, y: 0, - status + status: null } } }, diff --git a/src/components/status/status.js b/src/components/status/status.js index 99dc1b95..4f5093e1 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -104,7 +104,7 @@ const Status = { 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); + this.$emit('preview', Number(id), rect.left + 20, rect.top + 20 + window.pageYOffset) } }, replyLeave () { -- cgit v1.2.3-70-g09d2 From 0effef236a2221385fbba80ae93b017c40b11aad Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 7 Jun 2017 18:15:15 +0200 Subject: Small cleanup. --- src/components/conversation/conversation.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/components/conversation') diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index b781e40c..059028f9 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -1,4 +1,4 @@ -import { filter, sortBy } from 'lodash' +import { find, filter, sortBy } from 'lodash' import { statusType } from '../../modules/statuses.js' import Status from '../status/status.vue' @@ -86,8 +86,7 @@ const conversation = { if (id) { this.preview.x = x this.preview.y = y - this.preview.status = filter(this.conversation, { id: id })[0] - console.log(this.preview.status) + this.preview.status = find(this.conversation, { id: id }) } else { this.preview.status = null } -- cgit v1.2.3-70-g09d2