提交 54a794f2 编写于 作者: M Mike Greiling

adjust scrollToElement to account for fixed merge request tabs

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册