From 0460728a8c571b9a4468c2f93a2f8465fe37fa86 Mon Sep 17 00:00:00 2001 From: shpuld Date: Mon, 28 Jan 2019 21:59:17 +0200 Subject: [PATCH 1/2] Fix tall status expanding needing extra clicks, make tall status expand automatically in conversation when focused --- src/components/status/status.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 13e79dd0..c93580c0 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -31,7 +31,7 @@ const Status = { userExpanded: false, preview: null, showPreview: false, - showingTall: false, + showingTall: this.inConversation && this.focused, expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' ? !this.$store.state.instance.collapseMessageWithSubject : !this.$store.state.config.collapseMessageWithSubject, @@ -262,13 +262,14 @@ const Status = { this.userExpanded = !this.userExpanded }, toggleShowMore () { + console.log('toggleShowMore', this.showingTall) if (this.showingTall) { this.showingTall = false - } else if (this.expandingSubject) { + } else if (this.expandingSubject && this.status.summary) { this.expandingSubject = false } else if (this.hideTallStatus) { this.showingTall = true - } else if (this.hideSubjectStatus) { + } else if (this.hideSubjectStatus && this.status.summary) { this.expandingSubject = true } }, @@ -301,8 +302,10 @@ const Status = { 'highlight': function (id) { if (this.status.id === id) { let rect = this.$el.getBoundingClientRect() - if (rect.top < 100) { + if (rect.top < 140) { window.scrollBy(0, rect.top - 200) + } else if (rect.top < window.innerHeight && rect.height >= (window.innerHeight - 50)) { + window.scrollBy(0, rect.top - 50) } else if (rect.bottom > window.innerHeight - 50) { window.scrollBy(0, rect.bottom - window.innerHeight + 50) } From c3a931610a16a23659edc1140573a003e14c8dbc Mon Sep 17 00:00:00 2001 From: shpuld Date: Mon, 28 Jan 2019 22:03:25 +0200 Subject: [PATCH 2/2] remove log --- src/components/status/status.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index c93580c0..443e6b42 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -262,7 +262,6 @@ const Status = { this.userExpanded = !this.userExpanded }, toggleShowMore () { - console.log('toggleShowMore', this.showingTall) if (this.showingTall) { this.showingTall = false } else if (this.expandingSubject && this.status.summary) {