Skip to content

Commit fec1b0c

Browse files
committed
Rename functions working with line numbers
The term "line number" is ambiguous because there is a difference between a line number "within the diff" and a line number "within a file".
1 parent 80142bd commit fec1b0c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

code_comments/htdocs/code-comments.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var underscore = _.noConflict();
115115
if (!this.viewPerLine[line]) {
116116
this.viewPerLine[line] = new CommentsForALineView( { line: line } );
117117

118-
var $tr = $( Rows.getTrByLineNumber( line ) );
118+
var $tr = $( Rows.getTrByLineNumberInDiff( line ) );
119119
$tr.after(this.viewPerLine[line].render().el).addClass('with-comments');
120120
}
121121
this.viewPerLine[line].addOne(comment);
@@ -239,7 +239,7 @@ var underscore = _.noConflict();
239239
var callbackMouseover = function( event ) {
240240
var row = new RowView( { el: this } ),
241241
file = row.getFile(),
242-
line = row.getLineNumber(),
242+
line = row.getLineNumberInDiff(),
243243
displayLine = row.getDisplayLine();
244244
row.replaceLineNumberCellContent( '<a title="Comment on this line" href="#L' + line + '" class="bubble"><span class="ui-icon ui-icon-comment"></span></a>' );
245245

@@ -268,10 +268,10 @@ var underscore = _.noConflict();
268268
// wrap TH content in spans so we can hide/show them
269269
this.wrapTHsInSpans();
270270
},
271-
getLineByTR: function( tr ) {
271+
getLineNumberInDiffByTr: function( tr ) {
272272
return $.inArray( tr, this.$rows ) + 1;
273273
},
274-
getTrByLineNumber: function( line ) {
274+
getTrByLineNumberInDiff: function( line ) {
275275
return this.$rows[line - 1];
276276
},
277277
wrapTHsInSpans: function() {
@@ -303,8 +303,8 @@ var underscore = _.noConflict();
303303
getFile: function() {
304304
return this.$el.parents( 'li' ).find( 'h2>a:first' ).text();
305305
},
306-
getLineNumber: function() {
307-
return Rows.getLineByTR( this.el );
306+
getLineNumberInDiff: function() {
307+
return Rows.getLineNumberInDiffByTr( this.el );
308308
},
309309
getDisplayLine: function() {
310310
return this.$lineNumberCell.text().trim() || this.$th.first().text() + ' (deleted)';

0 commit comments

Comments
 (0)