Commit c00ba9a6 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'scroll-to-changes-content' into 'master'

Clicking changes tab scrolls the window to show the content

When you click on the changes tab in a merge request, it will now scroll the window down to the content.

![scroll](/uploads/c5db23e1c32b1fe62bf4efb815b3f055/scroll.gif)

Closes #15133

See merge request !4192
parents 28dbf931 72df2da7
...@@ -75,6 +75,9 @@ class @MergeRequestTabs ...@@ -75,6 +75,9 @@ class @MergeRequestTabs
@loadDiff($target.attr('href')) @loadDiff($target.attr('href'))
if bp? and bp.getBreakpointSize() isnt 'lg' if bp? and bp.getBreakpointSize() isnt 'lg'
@shrinkView() @shrinkView()
navBarHeight = $('.navbar-gitlab').outerHeight()
$.scrollTo(".merge-request-details .merge-request-tabs", offset: -navBarHeight)
else if action == 'builds' else if action == 'builds'
@loadBuilds($target.attr('href')) @loadBuilds($target.attr('href'))
@expandView() @expandView()
......
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