Rename expandCW to collapseMessageWithSubject.

Add option to config.json, disabled by default.
This commit is contained in:
ensra 2018-08-20 03:41:40 +01:00
parent 671db023da
commit 3ec8e43a97
8 changed files with 26 additions and 23 deletions

View file

@ -31,7 +31,7 @@ const Status = {
preview: null,
showPreview: false,
showingTall: false,
expandingCW: this.$store.state.config.expandCW
expandingSubject: !this.$store.state.config.collapseMessageWithSubject
}
},
computed: {
@ -105,14 +105,14 @@ const Status = {
const lengthScore = this.status.statusnet_html.split(/<p|<br/).length + this.status.text.length / 80
return lengthScore > 20
},
hideCWStatus () {
if (this.tallStatus && this.$store.state.config.expandCW) {
hideSubjectStatus () {
if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) {
return false
}
return !this.expandingCW && this.status.summary
return !this.expandingSubject && this.status.summary
},
hideTallStatus () {
if (this.status.summary && !this.$store.state.config.expandCW) {
if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) {
return false
}
if (this.showingTall) {
@ -121,7 +121,7 @@ const Status = {
return this.tallStatus
},
showingMore () {
return this.showingTall || (this.status.summary && this.expandingCW)
return this.showingTall || (this.status.summary && this.expandingSubject)
},
attachmentSize () {
if ((this.$store.state.config.hideAttachments && !this.inConversation) ||
@ -184,12 +184,12 @@ const Status = {
toggleShowMore () {
if (this.showingTall) {
this.showingTall = false
} else if (this.expandingCW) {
this.expandingCW = false
} else if (this.expandingSubject) {
this.expandingSubject = false
} else if (this.hideTallStatus) {
this.showingTall = true
} else if (this.hideCWStatus) {
this.expandingCW = true
} else if (this.hideSubjectStatus) {
this.expandingSubject = true
}
},
replyEnter (id, event) {

View file

@ -77,9 +77,9 @@
<div :class="{'tall-status': hideTallStatus}" class="status-content-wrapper">
<a class="tall-status-hider" :class="{ 'tall-status-hider_focused': isFocused }" v-if="hideTallStatus" href="#" @click.prevent="toggleShowMore">Show more</a>
<div @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html" v-if="!hideCWStatus"></div>
<div @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html" v-if="!hideSubjectStatus"></div>
<div @click.prevent="linkClicked" class="status-content media-body" v-html="status.summary" v-else></div>
<a v-if="hideCWStatus" href="#" class="cw-status-hider" @click.prevent="toggleShowMore">Show more</a>
<a v-if="hideSubjectStatus" href="#" class="cw-status-hider" @click.prevent="toggleShowMore">Show more</a>
<a v-if="showingMore" href="#" class="status-unhider" @click.prevent="toggleShowMore">Show less</a>
</div>