Skip to content

Commit

Permalink
Bugfix: Comments for the same line on different files all showed up o…
Browse files Browse the repository at this point in the history
…n the first file.
  • Loading branch information
SebDieBln committed Mar 4, 2018
1 parent dcc4fb3 commit 94605d5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code_comments/htdocs/code-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ var underscore = _.noConflict();
addOne: function(comment) {
var line = comment.get('line');
var file = comment.get('path');
if (!this.viewPerLine[line]) {
this.viewPerLine[line] = new CommentsForALineView( { file: file, line: line } );
var key = 'file_' + file + ':' + line;
if (!this.viewPerLine[key]) {
this.viewPerLine[key] = new CommentsForALineView( { file: file, line: line } );

var $tr = $( Rows.getTrByFileAndLineNumberInFile( file, line ) );
$tr.after(this.viewPerLine[line].render().el).addClass('with-comments');
$tr.after(this.viewPerLine[key].render().el).addClass('with-comments');
}
this.viewPerLine[line].addOne(comment);
this.viewPerLine[key].addOne(comment);
},
addAll: function() {
var view = this;
Expand Down

0 comments on commit 94605d5

Please sign in to comment.