summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-07-12 00:34:40 +0200
committerFatih Acet <acetfatih@gmail.com>2018-07-18 12:55:55 +0200
commit5be711ab6e818a62eb28a32d78a809b33f8ec63a (patch)
tree7ae2990d98acb28d2620b640362d163f0eebe225
parente868d09dbf9672100759bed9908de8f52b2603dc (diff)
downloadgitlab-ce-5be711ab6e818a62eb28a32d78a809b33f8ec63a.tar.gz
Add confirmation modal before cancelling the comment form in diff line note form.
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_note_form.vue8
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);