Change computed to isShowAttachments in toot

This commit is contained in:
AkiraFukushima 2019-01-24 00:05:09 +09:00
parent 80e9c7a92c
commit c6dda41188
1 changed files with 6 additions and 6 deletions

View File

@ -46,11 +46,11 @@
<div class="content" v-show="isShowContent" v-html="status()" @click.capture.prevent="tootClick"></div>
</div>
<div class="attachments">
<el-button v-show="sensitive && !isShowAttachments()" class="show-sensitive" type="info" @click="showAttachments = true">
<el-button v-show="sensitive && !isShowAttachments" class="show-sensitive" type="info" @click="showAttachments = true">
{{ $t('cards.toot.sensitive') }}
</el-button>
<div v-show="isShowAttachments()">
<el-button v-show="sensitive && isShowAttachments()" class="hide-sensitive" type="text" @click="showAttachments = false" :title="$t('cards.toot.hide')">
<div v-show="isShowAttachments">
<el-button v-show="sensitive && isShowAttachments" class="hide-sensitive" type="text" @click="showAttachments = false" :title="$t('cards.toot.hide')">
<icon name="eye" class="hide"></icon>
</el-button>
<div class="media" v-bind:key="media.preview_url" v-for="media in mediaAttachments">
@ -240,6 +240,9 @@ export default {
},
sensitive: function () {
return this.originalMessage.sensitive && this.mediaAttachments.length > 0
},
isShowAttachments: function () {
return !this.sensitive || this.showAttachments
}
},
mounted () {
@ -442,9 +445,6 @@ export default {
})
})
},
isShowAttachments () {
return !this.sensitive || this.showAttachments
},
filtered () {
return this.filter.length > 0 && this.originalMessage.content.search(this.filter) >= 0
},