summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-09-21 03:08:17 +0300
committerFatih Acet <acetfatih@gmail.com>2017-09-21 03:08:17 +0300
commitd9a3bbce61fc76aee6fb5cbc65e46e11af2affd0 (patch)
tree68cf676d8992d0ba08ea9e0c1f445e7ea7412521 /app
parentd15109dc5e6185b512785611cd3d146010e1eacc (diff)
downloadgitlab-ce-d9a3bbce61fc76aee6fb5cbc65e46e11af2affd0.tar.gz
IssueNotes: Resize comment form after note submit and discard.acet-fix-comment-form-resize
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes/components/issue_comment_form.vue8
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.