diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 98bd8956c..36ab7e0b4 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -105,9 +105,10 @@ :profile-user-id="profileUserId" :simple-tree="treeViewIsSimple" :show-other-replies-as-button="showOtherRepliesButtonInsideStatus" - :dive="() => diveIntoStatus(status.id)" + can-dive @goto="setHighlight" + @dive="() => diveIntoStatus(status.id)" @suspendable-state-change="onStatusSuspendStateChange" />
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js index 58ab3db0b..c244a8cb3 100644 --- a/src/components/gallery/gallery.js +++ b/src/components/gallery/gallery.js @@ -165,8 +165,8 @@ const Gallery = { } else { this.$emit('pause') } - } - } + }, + }, } export default Gallery diff --git a/src/components/status/status.js b/src/components/status/status.js index 93a92a552..ecbca4c94 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -75,44 +75,6 @@ library.add( const camelCase = (name) => name.charAt(0).toUpperCase() + name.slice(1) -const controlledOrUncontrolledGetters = (list) => - list.reduce((res, name) => { - const camelized = camelCase(name) - const toggle = `controlledToggle${camelized}` - const controlledName = `controlled${camelized}` - const uncontrolledName = `uncontrolled${camelized}` - res[name] = function () { - return (this.$data[toggle] !== undefined || - this.$props[toggle] !== undefined) && - this[toggle] - ? this[controlledName] - : this[uncontrolledName] - } - return res - }, {}) - -const controlledOrUncontrolledToggle = (obj, name) => { - const camelized = camelCase(name) - const toggle = `controlledToggle${camelized}` - const uncontrolledName = `uncontrolled${camelized}` - if (obj[toggle]) { - obj[toggle]() - } else { - obj[uncontrolledName] = !obj[uncontrolledName] - } -} - -const controlledOrUncontrolledSet = (obj, name, val) => { - const camelized = camelCase(name) - const set = `controlledSet${camelized}` - const uncontrolledName = `uncontrolled${camelized}` - if (obj[set]) { - obj[set](val) - } else { - obj[uncontrolledName] = val - } -} - const Status = { name: 'Status', components: { @@ -146,17 +108,22 @@ const Status = { inProfile: Boolean, inConversation: Boolean, inQuote: Boolean, + canDive: Boolean, profileUserId: String, simpleTree: Boolean, showOtherRepliesAsButton: Boolean, - dive: Function, + canDive: Boolean, ignoreMute: Boolean, - controlledThreadDisplayStatus: String, - controlledToggleThreadDisplay: Function, + threadDisplayStatus: String, }, - emits: ['goto', 'toggleExpanded', 'suspendableStateChange'], + emits: [ + 'goto', + 'dive', + 'toggleExpanded', + 'suspendableStateChange' + ], data() { return { replying: false, @@ -480,10 +447,10 @@ const Status = { return !this.replying && this.mediaPlaying.size === 0 }, inThreadForest() { - return !!this.controlledThreadDisplayStatus + return !!this.threadDisplayStatus }, threadShowing() { - return this.controlledThreadDisplayStatus === 'showing' + return this.threadDisplayStatus === 'showing' }, visibilityLocalized() { return this.$i18n.t('general.scope_in_timeline.' + this.status.visibility) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 2b54977c7..f301ad890 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -236,10 +236,10 @@ /> diff --git a/src/components/thread_tree/thread_tree.js b/src/components/thread_tree/thread_tree.js index bbb81b059..14e79e188 100644 --- a/src/components/thread_tree/thread_tree.js +++ b/src/components/thread_tree/thread_tree.js @@ -26,28 +26,14 @@ const ThreadTree = { toggleExpanded: Function, simple: Boolean, - // to control display of the whole thread forest - toggleThreadDisplay: Function, + canDive: Boolean, threadDisplayStatus: Object, showThreadRecursively: Function, totalReplyCount: Object, totalReplyDepth: Object, - dive: Function, }, - emits: ['suspendableStateChange'], + emits: ['suspendableStateChange', 'dive'], computed: { - suspendable() { - const selfSuspendable = this.$refs.statusComponent - ? this.$refs.statusComponent.suspendable - : true - if (this.$refs.childComponent) { - return ( - selfSuspendable && - this.$refs.childComponent.every((s) => s.suspendable) - ) - } - return selfSuspendable - }, reverseLookupTable() { return this.conversation.reduce( (table, status, index) => { @@ -72,21 +58,6 @@ const ThreadTree = { statusById(id) { return this.conversation[this.reverseLookupTable[id]] }, - collapseThread() { - /* no-op */ - }, - showThread() { - /* no-op */ - }, - showAllSubthreads() { - /* no-op */ - }, - toggleCurrentProp(name) { - this.toggleStatusContentProperty(this.status.id, name) - }, - setCurrentProp(name) { - this.setStatusContentProperty(this.status.id, name) - }, }, } diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue index f04315877..ee0aa75fb 100644 --- a/src/components/thread_tree/thread_tree.vue +++ b/src/components/thread_tree/thread_tree.vue @@ -3,30 +3,29 @@