diff options
| author | lambadalambda <gitgud@rogerbraun.net> | 2017-06-07 12:18:55 -0400 |
|---|---|---|
| committer | lambadalambda <gitgud@rogerbraun.net> | 2017-06-07 12:18:55 -0400 |
| commit | fc341aa40da786ea0b168bbee2f52add0514a046 (patch) | |
| tree | 81e56cbc5cbacfbbac69cd6a7357f9d485235c6e /src/components/conversation/conversation.js | |
| parent | 9982296866f0592747064d3cb6ddfac0fce516b1 (diff) | |
| parent | 0effef236a2221385fbba80ae93b017c40b11aad (diff) | |
Merge branch 'feature/reply-previews' into 'develop'
Reply previews in conversations
See merge request !89
Diffstat (limited to 'src/components/conversation/conversation.js')
| -rw-r--r-- | src/components/conversation/conversation.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 3e601c3d..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' @@ -10,7 +10,12 @@ const sortAndFilterConversation = (conversation) => { const conversation = { data () { return { - highlight: null + highlight: null, + preview: { + x: 0, + y: 0, + status: null + } } }, props: [ @@ -76,6 +81,15 @@ 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 = find(this.conversation, { id: id }) + } else { + this.preview.status = null + } } } } |
