aboutsummaryrefslogtreecommitdiff
path: root/src/components/status/status.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-05-02 14:17:27 +0000
committerShpuld Shpludson <shp@cock.li>2020-05-02 14:17:27 +0000
commita0f780c4550b77d4574e0de8932a2dff288784a3 (patch)
tree63be5e8364a2e86ab778749c7ee4b880fd2420f3 /src/components/status/status.js
parent8e049297ff6a125298ba9d06a3a4a563b231360f (diff)
parent2618c1b702d1881970cd1ee1109c421b24f2229e (diff)
Merge branch 'rc/2.0.3' into 'master'
Update MASTER with 2.0.3 for real See merge request pleroma/pleroma-fe!1099
Diffstat (limited to 'src/components/status/status.js')
-rw-r--r--src/components/status/status.js35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/components/status/status.js b/src/components/status/status.js
index fc5956ec..61d66301 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -188,23 +188,22 @@ const Status = {
}
return this.status.attentions.length > 0
},
+
+ // When a status has a subject and is also tall, we should only have one show more/less button. If the default is to collapse statuses with subjects, we just treat it like a status with a subject; otherwise, we just treat it like a tall status.
+ mightHideBecauseSubject () {
+ return this.status.summary && (!this.tallStatus || this.localCollapseSubjectDefault)
+ },
+ mightHideBecauseTall () {
+ return this.tallStatus && (!this.status.summary || !this.localCollapseSubjectDefault)
+ },
hideSubjectStatus () {
- if (this.tallStatus && !this.localCollapseSubjectDefault) {
- return false
- }
- return !this.expandingSubject && this.status.summary
+ return this.mightHideBecauseSubject && !this.expandingSubject
},
hideTallStatus () {
- if (this.status.summary && this.localCollapseSubjectDefault) {
- return false
- }
- if (this.showingTall) {
- return false
- }
- return this.tallStatus
+ return this.mightHideBecauseTall && !this.showingTall
},
showingMore () {
- return (this.tallStatus && this.showingTall) || (this.status.summary && this.expandingSubject)
+ return (this.mightHideBecauseTall && this.showingTall) || (this.mightHideBecauseSubject && this.expandingSubject)
},
nsfwClickthrough () {
if (!this.status.nsfw) {
@@ -408,14 +407,10 @@ const Status = {
this.userExpanded = !this.userExpanded
},
toggleShowMore () {
- if (this.showingTall) {
- this.showingTall = false
- } else if (this.expandingSubject && this.status.summary) {
- this.expandingSubject = false
- } else if (this.hideTallStatus) {
- this.showingTall = true
- } else if (this.hideSubjectStatus && this.status.summary) {
- this.expandingSubject = true
+ if (this.mightHideBecauseTall) {
+ this.showingTall = !this.showingTall
+ } else if (this.mightHideBecauseSubject) {
+ this.expandingSubject = !this.expandingSubject
}
},
generateUserProfileLink (id, name) {