diff options
| author | lambda <pleromagit@rogerbraun.net> | 2019-01-30 17:47:46 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2019-01-30 17:47:46 +0000 |
| commit | 0bd77149a06bcd7e0a904d0f5c2e2691996ff898 (patch) | |
| tree | b028987211819bd2277386defa3e9ca5888efff5 /src | |
| parent | d0df98f99b66cf003973346bcb1f6cdd7e4be33c (diff) | |
| parent | 0a39159fdf99143ddf05580f066508e6d5a90773 (diff) | |
Merge branch 'fix/tall-statuses-v2' into 'develop'
More tall status related fixes that I didn't know was borkd
See merge request pleroma/pleroma-fe!498
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/status/status.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js index f7b0357b..2e418f0c 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -180,7 +180,7 @@ const Status = { return this.tallStatus }, showingMore () { - return this.showingTall || (this.status.summary && this.expandingSubject) + return (this.tallStatus && this.showingTall) || (this.status.summary && this.expandingSubject) }, nsfwClickthrough () { if (!this.status.nsfw) { @@ -316,11 +316,14 @@ const Status = { 'highlight': function (id) { if (this.status.id === id) { let rect = this.$el.getBoundingClientRect() - 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) + if (rect.top < 100) { + // Post is above screen, match its top to screen top + window.scrollBy(0, rect.top - 100) + } else if (rect.height >= (window.innerHeight - 50)) { + // Post we want to see is taller than screen so match its top to screen top + window.scrollBy(0, rect.top - 100) } else if (rect.bottom > window.innerHeight - 50) { + // Post is below screen, match its bottom to screen bottom window.scrollBy(0, rect.bottom - window.innerHeight + 50) } } |
