Merge "Fix keyLocation computation on ranged comments"

This commit is contained in:
Tao Zhou
2019-10-21 12:26:32 +00:00
committed by Gerrit Code Review

View File

@@ -400,7 +400,13 @@
const commentSide = threadEl.getAttribute('comment-side');
const lineNum = Number(threadEl.getAttribute('line-num')) ||
GrDiffLine.FILE;
const commentRange = threadEl.range || {};
keyLocations[commentSide][lineNum] = true;
// Add start_line as well if exists,
// the being and end of the range should not be collapsed.
if (commentRange.start_line) {
keyLocations[commentSide][commentRange.start_line] = true;
}
}
return keyLocations;
},