summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes.js
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-30 20:34:14 -0600
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 17:44:14 +0100
commitfe26b8af94e8e12a66249e28e34196a4f8b987c4 (patch)
treed4a2978d3d28afdb45b69f177293167dd018717a /app/assets/javascripts/notes.js
parentbb8cc946689bfafb1e3a65aa00b8e75fb8a5006b (diff)
downloadgitlab-ce-fe26b8af94e8e12a66249e28e34196a4f8b987c4.tar.gz
Correctly display multiple separate discussions on the same diff line
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r--app/assets/javascripts/notes.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index 57335c77e40..edfcda7c214 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -668,7 +668,7 @@ require('./task_list');
return function(i, el) {
var note, notes;
note = $(el);
- notes = note.closest(".notes");
+ notes = note.closest(".discussion-notes");
if (typeof gl.diffNotesCompileComponents !== 'undefined') {
if (gl.diffNoteApps[noteElId]) {
@@ -685,14 +685,13 @@ require('./task_list');
// "Discussions" tab
notes.closest(".timeline-entry").remove();
- if (!_this.isParallelView() || notesTr.find('.note').length === 0) {
- // "Changes" tab / commit view
- notesTr.remove();
+ // The notes tr can contain multiple lists of notes, like on the parallel diff
+ if (notesTr.find('.discussion-notes').length > 1) {
+ notes.remove();
} else {
- notes.closest('.content').empty();
+ notesTr.remove();
}
}
- return note.remove();
};
})(this));
// Decrement the "Discussions" counter only once