diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-09-21 03:08:17 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-09-21 03:08:17 +0300 |
commit | d9a3bbce61fc76aee6fb5cbc65e46e11af2affd0 (patch) | |
tree | 68cf676d8992d0ba08ea9e0c1f445e7ea7412521 /app/assets/javascripts/notes | |
parent | d15109dc5e6185b512785611cd3d146010e1eacc (diff) |
IssueNotes: Resize comment form after note submit and discard.
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r-- | app/assets/javascripts/notes/components/issue_comment_form.vue | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/components/issue_comment_form.vue b/app/assets/javascripts/notes/components/issue_comment_form.vue index 16f4e22aa9b..183d8e5aa38 100644 --- a/app/assets/javascripts/notes/components/issue_comment_form.vue +++ b/app/assets/javascripts/notes/components/issue_comment_form.vue @@ -2,6 +2,7 @@ /* global Flash, Autosave */ import { mapActions, mapGetters } from 'vuex'; import _ from 'underscore'; + import autosize from 'vendor/autosize'; import '../../autosave'; import TaskList from '../../task_list'; import * as constants from '../constants'; @@ -124,6 +125,7 @@ } this.isSubmitting = true; this.note = ''; // Empty textarea while being requested. Repopulate in catch + this.resizeTextarea(); this.saveNote(noteData) .then((res) => { @@ -174,6 +176,7 @@ if (shouldClear) { this.note = ''; + this.resizeTextarea(); } // reset autostave @@ -205,6 +208,11 @@ selector: '.notes', }); }, + resizeTextarea() { + this.$nextTick(() => { + autosize.update(this.$refs.textarea); + }); + }, }, mounted() { // jQuery is needed here because it is a custom event being dispatched with jQuery. |