Add lineNum class even when button is not shown

It is used in various selectors to find the row to insert file comments.

Change-Id: I54a55351bbfc0ee9dc8354d91837ab5bfa26b9ce
This commit is contained in:
Ole
2020-06-18 13:03:18 +02:00
parent d29dedbc49
commit 222e809cf9

View File

@@ -318,6 +318,7 @@ GrDiffBuilder.prototype._createLineEl = function(
// Both td and button need a number of classes/attributes for various
// selectors to work.
this._decorateLineEl(td, number, side);
td.classList.add('lineNum');
if (this._prefs.show_file_comment_button === false && number === 'FILE') {
return td;
@@ -328,7 +329,6 @@ GrDiffBuilder.prototype._createLineEl = function(
button.tabIndex = -1;
this._decorateLineEl(button, number, side);
td.classList.add('lineNum');
button.classList.add('lineNumButton');
button.textContent = number === 'FILE' ? 'File' : number;