diff options
author | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-02-25 13:51:17 -0500 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-03-10 12:20:00 -0500 |
commit | 4f954d6adc87e976204ea7b7e47a974d2938cf59 (patch) | |
tree | f3b36ca1de4a96746d5b1a895f9e9317439d0535 /app | |
parent | 26541240dca29ca8608fbc93f03310682daf8e0d (diff) | |
download | gitlab-ce-4f954d6adc87e976204ea7b7e47a974d2938cf59.tar.gz |
Add error for ajax:error when submitting comments
Fixes #13814
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 7 |
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 |