summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-09-17 00:01:42 +0000
committerJacob Schatz <jschatz@gitlab.com>2016-09-17 00:01:42 +0000
commitd38499b3a785ea9d15cb3f108764d20016ea8ea7 (patch)
treef8528bcb88351018b953c32404d3729c06a1a738
parent35bed03c99c12488f88fa49602a5e77ad08bcfa4 (diff)
parent2eb2cbe6ae4aa8c66966f47f84551c76d114af75 (diff)
downloadgitlab-ce-d38499b3a785ea9d15cb3f108764d20016ea8ea7.tar.gz
Merge branch 'diff-line-highlighting-fix' into 'master'
Fix line diff side-by-side line highlighting ## What does this MR do? Fixes line highlighting in diff side-by-side view from working correctly. The JS was looking for a class, but the class doesn't exist & instead it was a data attribute. ## Screenshots (if relevant) ![Screen_Shot_2016-09-13_at_10.26.15](/uploads/7aca730efb14d7bd6bad2a8712fe39d2/Screen_Shot_2016-09-13_at_10.26.15.png) See merge request !6316
-rw-r--r--app/assets/javascripts/merge_request_tabs.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js
index dcba4a8d275..18bbfa7a459 100644
--- a/app/assets/javascripts/merge_request_tabs.js
+++ b/app/assets/javascripts/merge_request_tabs.js
@@ -232,10 +232,10 @@
$('.hll').removeClass('hll');
locationHash = window.location.hash;
if (locationHash !== '') {
- hashClassString = "." + (locationHash.replace('#', ''));
+ dataLineString = '[data-line-code="' + locationHash.replace('#', '') + '"]';
$diffLine = $(locationHash + ":not(.match)", $('#diffs'));
if (!$diffLine.is('tr')) {
- $diffLine = $('#diffs').find("td" + locationHash + ", td" + hashClassString);
+ $diffLine = $('#diffs').find("td" + locationHash + ", td" + dataLineString);
} else {
$diffLine = $diffLine.find('td');
}