diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-12-08 10:36:26 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-12-08 10:36:26 +0900 |
| commit | 596f92cfccdc3f7877ac16e5ddfb3dc489eb5fc2 (patch) | |
| tree | 7e2262ec1da66fd28676bdd9f21e05ff03281ae7 /src/client/app/common | |
| parent | Add comment (diff) | |
| download | misskey-596f92cfccdc3f7877ac16e5ddfb3dc489eb5fc2.tar.gz misskey-596f92cfccdc3f7877ac16e5ddfb3dc489eb5fc2.tar.bz2 misskey-596f92cfccdc3f7877ac16e5ddfb3dc489eb5fc2.zip | |
[Client] Improve cw-button
Diffstat (limited to 'src/client/app/common')
| -rw-r--r-- | src/client/app/common/views/components/cw-button.vue | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/client/app/common/views/components/cw-button.vue b/src/client/app/common/views/components/cw-button.vue index bda39f2d48..034848a116 100644 --- a/src/client/app/common/views/components/cw-button.vue +++ b/src/client/app/common/views/components/cw-button.vue @@ -1,21 +1,36 @@ <template> -<button class="nrvgflfuaxwgkxoynpnumyookecqrrvh" @click="toggle">{{ value ? this.$t('hide') : this.$t('show') }}</button> +<button class="nrvgflfuaxwgkxoynpnumyookecqrrvh" @click="toggle"> + <b>{{ value ? this.$t('hide') : this.$t('show') }}</b> + <span v-if="!value"> + <span v-if="note.text">{{ this.$t('chars', { count: length(note.text) }) | number }}</span> + <span v-if="note.text && note.files && note.files.length > 0"> / </span> + <span v-if="note.files && note.files.length > 0">{{ this.$t('files', { count: note.files.length }) }}</span> + </span> +</button> </template> <script lang="ts"> import Vue from 'vue'; import i18n from '../../../i18n'; +import { length } from 'stringz'; export default Vue.extend({ i18n: i18n('common/views/components/cw-button.vue'), + props: { value: { type: Boolean, required: true + }, + note: { + type: Object, + required: true } }, methods: { + length, + toggle() { this.$emit('input', !this.value); } @@ -37,4 +52,12 @@ export default Vue.extend({ &:hover background var(--cwButtonHoverBg) + > span + margin-left 4px + + &:before + content '(' + &:after + content ')' + </style> |