diff options
| author | dtluna <dtluna@openmailbox.org> | 2018-02-09 17:51:04 +0300 |
|---|---|---|
| committer | dtluna <dtluna@openmailbox.org> | 2018-02-09 17:51:04 +0300 |
| commit | 6c424c355c7faa70c84614b9c518ee116b42dd53 (patch) | |
| tree | f11a4e98af45988ba8a7cedcc87d4314bbc67067 | |
| parent | e49cf7b67a3d1532ff19091697c4d2487e14d257 (diff) | |
Add characters left being displayed
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 12 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 1f63de25..c1213fa9 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -94,6 +94,18 @@ const PostStatusForm = { }, customEmoji () { return this.$store.state.config.customEmoji || [] + }, + statusLength () { + return this.newStatus.status.length + }, + statusLengthLimit () { + return this.$store.state.config.textlimit + }, + hasStatusLengthLimit () { + return this.statusLengthLimit > 0 + }, + charactersLeft () { + return this.statusLengthLimit - this.statusLength } }, methods: { diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 8e436428..86458f0d 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -18,6 +18,9 @@ </div> <div class='form-bottom'> <media-upload @uploading="disableSubmit" @uploaded="addMediaFile" @upload-failed="enableSubmit" :drop-files="dropFiles"></media-upload> + + <p v-if="hasStatusLengthLimit">{{ charactersLeft }}</p> + <button v-if="posting" disabled class="btn btn-default base05 base02-background">{{$t('post_status.posting')}}</button> <button v-else :disabled="submitDisabled" type="submit" class="btn btn-default base05 base02-background">{{$t('general.submit')}}</button> </div> |
