diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js index 7efaf1158..5570f6ac3 100644 --- a/src/components/conversation/conversation.js +++ b/src/components/conversation/conversation.js @@ -433,12 +433,6 @@ const conversation = { virtualHidden() { this.updateVirtualHeight() }, - status: { - handler() { - this.updateVirtualHeight() - }, - deep: true, - } }, methods: { fetchConversation() { @@ -615,9 +609,6 @@ const conversation = { this.threadDisplayStatusObject = {} }, onStatusSuspendStateChange({ id, suspend }) { - this.$nextTick(() => { - this.virtualHeight = this.$refs.body.clientHeight - }) if (!suspend) { this.unsuspendibleIds.add(id) } else { @@ -630,8 +621,11 @@ const conversation = { } }, updateVirtualHeight() { - this.$emit('update:virtualHeight', { id: this.status.id, height: this.virtualHeight }) - this.virtualHeight = this.$refs.body.clientHeight + this.$nextTick(() => { + console.log('LMAO', this.$refs.body.clientHeight) + this.virtualHeight = this.$refs.body.clientHeight + this.$emit('update:virtualHeight', { id: this.status.id, height: this.virtualHeight, top: this.$el.clientTop }) + }) }, }, } diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index dd7ee65b3..cc1376978 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -118,6 +118,7 @@ @goto="setFocused" @dive="() => diveIntoStatus(status.id)" @suspendable-state-change="onStatusSuspendStateChange" + @height-change="updateVirtualHeight" />
diff --git a/src/components/status/status.js b/src/components/status/status.js index 749e0a12e..5b5edb845 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -118,7 +118,7 @@ const Status = { threadDisplayStatus: String, }, - emits: ['goto', 'dive', 'toggleExpanded', 'suspendableStateChange'], + emits: ['goto', 'dive', 'toggleExpanded', 'suspendableStateChange', 'heightChange'], data() { return { replying: false, @@ -539,6 +539,7 @@ const Status = { this.headTailLinks = headTailLinks }, toggleThreadDisplay() { + // FIXME this.controlledToggleThreadDisplay() }, scrollIfFocused(focused) { @@ -557,8 +558,22 @@ const Status = { } } }, + onTransitionEnd() { + this.$nextTick(() => { + this.$emit('heightChange') + }) + }, }, watch: { + status: { + deep: true, + handler() { + this.$emit('heightChange') + }, + }, + replying() { + this.$emit('heightChange') + }, focused: function (id) { this.scrollIfFocused(id) }, @@ -584,6 +599,7 @@ const Status = { }, isSuspendable: function (suspend) { this.$emit('suspendableStateChange', { id: this.status.id, suspend }) + this.$emit('heightChange') }, }, } diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f0b2f1277..8cc8c95f0 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -454,7 +454,10 @@ -