summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-05-26 14:46:54 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-02 13:23:47 +0200
commit46a83371d523acd9d69f5c18bb2bb04968076387 (patch)
tree0f4f8c9043ad726ebe387d2e2b90e6fc136c2105
parent42b9a51581e081769b8622c7a529c0a7a9767c1f (diff)
downloadgitlab-ce-46a83371d523acd9d69f5c18bb2bb04968076387.tar.gz
Merge branch 'discussion-outdated-form' into 'master'
Fixed JS error when trying to remove discussion form ## What does this MR do? Fixes a JS error which was caused by an ID of the form not matching what was returned by the JSON. Instead of checking that, it gets the current form from the ajax success event. This would only happen on outdated discussions because the ID of the discussion form ends with `-false` because it isn't active. However, the note is added to an active discussion so the ID returned actually ends in `-true` & therefore the JS couldn't find the correct form. ## What are the relevant issue numbers? Closes #17778 See merge request !4303
-rw-r--r--app/assets/javascripts/notes.js.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 6d9d6528f45..8131d923677 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -329,7 +329,7 @@ class @Notes
@renderDiscussionNote(note)
# cleanup after successfully creating a diff/discussion note
- @removeDiscussionNoteForm($("#new-discussion-note-form-#{note.discussion_id}"))
+ @removeDiscussionNoteForm($(xhr.target))
###
Called in response to the edit note form being submitted