forked from AkkomaGang/akkoma-fe
Merge branch 'issue-154-shorten-cw-subject' into 'develop'
Issue #154 shorten subject Closes #154 See merge request pleroma/pleroma-fe!520
This commit is contained in:
commit
3cd1deb133
2 changed files with 11 additions and 2 deletions
|
@ -36,6 +36,7 @@ const Status = {
|
|||
preview: null,
|
||||
showPreview: false,
|
||||
showingTall: this.inConversation && this.focused,
|
||||
showingLongSubject: false,
|
||||
expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined'
|
||||
? !this.$store.state.instance.collapseMessageWithSubject
|
||||
: !this.$store.state.config.collapseMessageWithSubject,
|
||||
|
@ -130,6 +131,9 @@ const Status = {
|
|||
const lengthScore = this.status.statusnet_html.split(/<p|<br/).length + this.status.text.length / 80
|
||||
return lengthScore > 20
|
||||
},
|
||||
longSubject () {
|
||||
return this.status.summary.length > 900
|
||||
},
|
||||
isReply () {
|
||||
return !!(this.status.in_reply_to_status_id && this.status.in_reply_to_user_id)
|
||||
},
|
||||
|
|
|
@ -88,7 +88,12 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div :class="{'tall-status': hideTallStatus}" class="status-content-wrapper">
|
||||
<div class="status-content-wrapper" :class="{ 'tall-status': !showingLongSubject }" v-if="longSubject">
|
||||
<a class="tall-status-hider" :class="{ 'tall-status-hider_focused': isFocused }" v-if="!showingLongSubject" href="#" @click.prevent="showingLongSubject=true">Show more</a>
|
||||
<div @click.prevent="linkClicked" class="status-content media-body" v-html="status.statusnet_html"></div>
|
||||
<a v-if="showingLongSubject" href="#" class="status-unhider" @click.prevent="showingLongSubject=false">Show less</a>
|
||||
</div>
|
||||
<div :class="{'tall-status': hideTallStatus}" class="status-content-wrapper" v-else>
|
||||
<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="!hideSubjectStatus"></div>
|
||||
<div @click.prevent="linkClicked" class="status-content media-body" v-html="status.summary_html" v-else></div>
|
||||
|
@ -96,7 +101,7 @@
|
|||
<a v-if="showingMore" href="#" class="status-unhider" @click.prevent="toggleShowMore">Show less</a>
|
||||
</div>
|
||||
|
||||
<div v-if="status.attachments && !hideSubjectStatus" class="attachments media-body">
|
||||
<div v-if="status.attachments && (!hideSubjectStatus || showingLongSubject)" class="attachments media-body">
|
||||
<attachment
|
||||
class="non-gallery"
|
||||
v-for="attachment in nonGalleryAttachments"
|
||||
|
|
Loading…
Reference in a new issue