diff options
author | Fatih Acet <acetfatih@gmail.com> | 2018-07-12 00:34:40 +0200 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2018-07-18 12:55:55 +0200 |
commit | 5be711ab6e818a62eb28a32d78a809b33f8ec63a (patch) | |
tree | 7ae2990d98acb28d2620b640362d163f0eebe225 /app | |
parent | e868d09dbf9672100759bed9908de8f52b2603dc (diff) | |
download | gitlab-ce-5be711ab6e818a62eb28a32d78a809b33f8ec63a.tar.gz |
Add confirmation modal before cancelling the comment form in diff line note form.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_line_note_form.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue index 7a04ca6357c..5476fb47967 100644 --- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue +++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue @@ -57,10 +57,16 @@ export default { ...mapActions('diffs', ['cancelCommentForm']), ...mapActions(['saveNote', 'refetchDiscussionById']), handleCancelCommentForm() { + if (!window.confirm('Are you sure you want to cancel creating this comment?')) { + return; + } + this.cancelCommentForm({ lineCode: this.line.lineCode, }); - this.resetAutoSave(); + this.$nextTick(() => { + this.resetAutoSave(); + }); }, handleSaveNote(note) { const selectedDiffFile = this.getDiffFileByHash(this.diffFileHash); |