diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-11 12:49:55 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-11 12:49:55 -0500 |
commit | 48eccdb2fcfa28c2ab602b76b97ff064195bb113 (patch) | |
tree | 861f99f97ed5f1dbab67cbb14c71f05e73299e54 /app/assets | |
parent | a2a68858c88151ce0d77f602dbae59d595495ac6 (diff) | |
parent | 1a9d6ec71eafddf8cd6542b47b5473a6a3ba19b9 (diff) | |
download | gitlab-ce-48eccdb2fcfa28c2ab602b76b97ff064195bb113.tar.gz |
Merge branch 'fix-delete-notes-on-merge-request-diff' into 'master'
Fix delete notes on merge request diff
Fixes #3971
See merge request !2061
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index a7d720fff4b..35dc7829da2 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -350,18 +350,26 @@ class @Notes ### removeNote: -> note = $(this).closest(".note") - notes = note.closest(".notes") + note_id = note.attr('id') - # check if this is the last note for this line - if notes.find(".note").length is 1 + $('.note[id="' + note_id + '"]').each -> + note = $(this) + notes = note.closest(".notes") + count = notes.closest(".notes_holder").find(".discussion-notes-count") - # for discussions - notes.closest(".discussion").remove() + # check if this is the last note for this line + if notes.find(".note").length is 1 - # for diff lines - notes.closest("tr").remove() + # for discussions + notes.closest(".discussion").remove() - note.remove() + # for diff lines + notes.closest("tr").remove() + else + # update notes count + count.get(0).lastChild.nodeValue = " #{notes.children().length - 1}" + + note.remove() ### Called in response to clicking the delete attachment link |