diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-04-21 16:44:53 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-04-21 16:44:53 +0000 |
commit | 305b8159de238a692bea41d47326fff49e04dd96 (patch) | |
tree | bb80357011766a1f53a073d541f9bb97637bdec3 /app/assets | |
parent | d2bf73b7763a4cf51d3319cf8056534a2ce22fda (diff) | |
parent | 2dbfa1de27f5123b4be75b46cdebfae1f3fdbdeb (diff) | |
download | gitlab-ce-305b8159de238a692bea41d47326fff49e04dd96.tar.gz |
Merge branch 'diff-link-fix' into 'master'
Diff highlight fixes
This fixes a couple of issues with linking/highlight diff lines:
- Fixed issue with lines not being selectable when expanding diff
- Fixed issue with incorrect line being highlighted if line is in discussion view
See merge request !3725
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js.coffee | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.coffee b/app/assets/javascripts/merge_request_tabs.js.coffee index e8613cab72b..372732d0aac 100644 --- a/app/assets/javascripts/merge_request_tabs.js.coffee +++ b/app/assets/javascripts/merge_request_tabs.js.coffee @@ -87,8 +87,8 @@ class @MergeRequestTabs if window.location.hash navBarHeight = $('.navbar-gitlab').outerHeight() - $el = $("#{container} #{window.location.hash}") - $.scrollTo("#{container} #{window.location.hash}", offset: -navBarHeight) if $el.length + $el = $("#{container} #{window.location.hash}:not(.match)") + $.scrollTo("#{container} #{window.location.hash}:not(.match)", offset: -navBarHeight) if $el.length # Activate a tab based on the current action activateTab: (action) -> @@ -176,12 +176,12 @@ class @MergeRequestTabs if locationHash isnt '' hashClassString = ".#{locationHash.replace('#', '')}" - $diffLine = $(locationHash) + $diffLine = $("#{locationHash}:not(.match)", $('#diffs')) - if $diffLine.is ':not(tr)' - $diffLine = $("td#{locationHash}, td#{hashClassString}") + if not $diffLine.is 'tr' + $diffLine = $('#diffs').find("td#{locationHash}, td#{hashClassString}") else - $diffLine = $('td', $diffLine) + $diffLine = $diffLine.find('td') if $diffLine.length $diffLine.addClass 'hll' |