summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-11 13:00:59 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-11 13:00:59 +0000
commit1f08363650169925f01261863ee905ad103a177f (patch)
treea5060fd083044d278328c0170f3467a20b32789b /app
parent1cdc355a0fac752a9cd27552f3cf6823e8deaf87 (diff)
parent136ba502d3ad3378f7746a18c3045346a2f49081 (diff)
downloadgitlab-ce-1f08363650169925f01261863ee905ad103a177f.tar.gz
Merge branch 'comment-error' into 'master'
Add error for ajax:error when submitting comments Fixes #13814 ![Screen_Shot_2016-02-25_at_1.54.56_PM](/uploads/d70d706d306079df1b00d70f09affb63/Screen_Shot_2016-02-25_at_1.54.56_PM.png) cc @dblessing See merge request !2976
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js.coffee7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 863a4edfad7..cb6b7b29935 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -30,6 +30,9 @@ class @Notes
$(document).on "ajax:success", ".js-main-target-form", @addNote
$(document).on "ajax:success", ".js-discussion-note-form", @addDiscussionNote
+ # catch note ajax errors
+ $(document).on "ajax:error", ".js-main-target-form", @addNoteError
+
# change note in UI after update
$(document).on "ajax:success", "form.edit-note", @updateNote
@@ -309,6 +312,10 @@ class @Notes
addNote: (xhr, note, status) =>
@renderNote(note)
+ addNoteError: (xhr, note, status) =>
+ flash = new Flash('Your comment could not be submitted! Please check your network connection and try again.', 'alert')
+ flash.pinTo('.md-area')
+
###
Called in response to the new note form being submitted