diff --git a/app/coffeescripts/discussions/Reply.coffee b/app/coffeescripts/discussions/Reply.coffee index 6359a6cd3a5..e3f62ba2980 100644 --- a/app/coffeescripts/discussions/Reply.coffee +++ b/app/coffeescripts/discussions/Reply.coffee @@ -10,6 +10,7 @@ define [ 'compiled/views/editor/KeyboardShortcuts' 'str/stripTags' 'tinymce.editor_box' + 'jquery.instructure_forms' ], (Backbone, _, I18n, $, Entry, htmlEscape, replyAttachmentTemplate, preventDefault, KeyboardShortcuts, stripTags) -> class Reply @@ -126,9 +127,15 @@ define [ # Callback when the model is succesfully saved # # @api private - onPostReplySuccess: (entry) => - @view.model.set 'notification', '' - @trigger 'save', entry + onPostReplySuccess: (entry, response) => + if response.errors + @hideNotification() + @textArea.val entry.get('message') + @edit() + @form.formErrors(response) + else + @view.model.set 'notification', '' + @trigger 'save', entry ## # Callback when the model fails to save