diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2017-09-21 23:41:58 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-09-21 23:41:58 +0300 |
commit | 137c5822ecfb07bf453198f4025c4a30b100fc86 (patch) | |
tree | 2cdebeac4ea8c9a67e51859933f243621eb24734 /app/assets/javascripts/notes | |
parent | cfc2294fc859752d3c89cca3fe1e47eaf895a4ca (diff) | |
parent | d9a3bbce61fc76aee6fb5cbc65e46e11af2affd0 (diff) |
Merge branch 'acet-fix-comment-form-resize' into 'master'
IssueNotes: Resize comment form after note submit and discard.
Closes #38115
See merge request gitlab-org/gitlab-ce!14401
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. |