Commit 54a794f2 authored by Mike Greiling's avatar Mike Greiling

adjust scrollToElement to account for fixed merge request tabs

parent c434568f
...@@ -135,12 +135,14 @@ ...@@ -135,12 +135,14 @@
scrollToElement(container) { scrollToElement(container) {
if (location.hash) { if (location.hash) {
const navBarHeight = $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight() + document.querySelector('.js-tabs-affix').offsetHeight; const offset = 0 - (
$('.navbar-gitlab').outerHeight() +
$('.layout-nav').outerHeight() +
$('.js-tabs-affix').outerHeight()
);
const $el = $(`${container} ${location.hash}:not(.match)`); const $el = $(`${container} ${location.hash}:not(.match)`);
if ($el.length) { if ($el.length > 0) {
$.scrollTo($el[0], { $.scrollTo($el[0], { offset });
offset: -navBarHeight,
});
} }
} }
} }
......
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