Commit e405811d authored by Jacob Schatz's avatar Jacob Schatz Committed by Robert Speicher

Merge branch 'diff-scroll-point' into 'master'

Fixed issue when opening a highlighted line diff

## What does this MR do?

With the new project nav being fixed, the diff page is scrolling the highlighted under the nav meaning you cant see what is highlighted. This corrects that by added the height of the new project nav into the offset.

See merge request !4597
parent 80fc11ac
...@@ -88,7 +88,7 @@ class @MergeRequestTabs ...@@ -88,7 +88,7 @@ class @MergeRequestTabs
scrollToElement: (container) -> scrollToElement: (container) ->
if window.location.hash if window.location.hash
navBarHeight = $('.navbar-gitlab').outerHeight() navBarHeight = $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight()
$el = $("#{container} #{window.location.hash}:not(.match)") $el = $("#{container} #{window.location.hash}:not(.match)")
$.scrollTo("#{container} #{window.location.hash}:not(.match)", offset: -navBarHeight) if $el.length $.scrollTo("#{container} #{window.location.hash}:not(.match)", offset: -navBarHeight) if $el.length
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment