aboutsummaryrefslogtreecommitdiff
path: root/src/components/conversation
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/conversation')
-rw-r--r--src/components/conversation/conversation.js37
-rw-r--r--src/components/conversation/conversation.vue3
2 files changed, 38 insertions, 2 deletions
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 0abb7abd..6fc86b2c 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -2,7 +2,8 @@ import { reduce, filter, findIndex, clone, get } from 'lodash'
import Status from '../status/status.vue'
import ThreadTree from '../thread_tree/thread_tree.vue'
-const debug = console.log
+// const debug = console.log
+const debug = () => {}
const sortById = (a, b) => {
const idA = a.type === 'retweet' ? a.retweeted_status.id : a.id
@@ -39,7 +40,8 @@ const conversation = {
return {
highlight: null,
expanded: false,
- threadDisplayStatusObject: {} // id => 'showing' | 'hidden'
+ threadDisplayStatusObject: {}, // id => 'showing' | 'hidden'
+ statusContentPropertiesObject: {}
}
},
props: [
@@ -236,6 +238,25 @@ const conversation = {
a[id] = status
return a
}, {})
+ },
+ statusContentProperties () {
+ return this.conversation.reduce((a, k) => {
+ const id = k.id
+ const depth = this.depths[id]
+ const props = (() => {
+ if (this.statusContentPropertiesObject[id]) {
+ return this.statusContentPropertiesObject[id]
+ }
+ return {
+ showingTall: false,
+ expandingSubject: false,
+ showingLongSubject: false,
+ }
+ })()
+
+ a[id] = props
+ return a
+ }, {})
}
},
components: {
@@ -326,6 +347,18 @@ const conversation = {
},
showThreadRecursively (id) {
this.setThreadDisplayRecursively(id, 'showing')
+ },
+ setStatusContentProperty (id, name, value) {
+ this.statusContentPropertiesObject = {
+ ...this.statusContentPropertiesObject,
+ [id]: {
+ ...this.statusContentPropertiesObject[id],
+ [name]: value
+ }
+ }
+ },
+ toggleStatusContentProperty (id, name) {
+ this.setStatusContentProperty(id, name, !this.statusContentProperties[id][name])
}
}
}
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 783cc894..08cb72d0 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -44,6 +44,9 @@
:show-thread-recursively="showThreadRecursively"
:total-reply-count="totalReplyCount"
:total-reply-depth="totalReplyDepth"
+ :status-content-properties="statusContentProperties"
+ :set-status-content-property="setStatusContentProperty"
+ :toggle-status-content-property="toggleStatusContentProperty"
/>
</div>
<div v-if="isLinearView">