Ignore triple clicks for other gr-diff-highlight instances
At the moment, gr-diff-highlight react to selection change event, so if
there are multiple instances on the page, for example in gr-change-view,
all instances react to selection.
This change makes gr-diff-highlight to ignore selections for other
instances, thus reacting only its own selection.
Bug: Issue 5504
Change-Id: I9f0e1dc7fe9f316400d9c96fb0c8c5f7ff78d779
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-highlight/gr-diff-highlight.js b/polygerrit-ui/app/elements/diff/gr-diff-highlight/gr-diff-highlight.js
index 9cf6228..e32d7d6 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-highlight/gr-diff-highlight.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-highlight/gr-diff-highlight.js
@@ -116,6 +116,10 @@
* @return {!Object} fixed normalized range
*/
_fixTripleClickSelection: function(range, domRange) {
+ if (!range.start) {
+ // Selection outside of current diff.
+ return range;
+ }
var start = range.start;
var end = range.end;
var endsAtOtherSideLineNum =