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 @@
scrollToElement(container) {
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)`);
if ($el.length) {
$.scrollTo($el[0], {
offset: -navBarHeight,
});
if ($el.length > 0) {
$.scrollTo($el[0], { offset });
}
}
}
......
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