Commit c7e5d046 authored by Mike Greiling's avatar Mike Greiling

Merge branch '47846-position-is-off-when-visiting-files-with-anchors' into 'master'

Resolve "Position is off when visiting files with anchors"

Closes #47846

See merge request gitlab-org/gitlab-ce!28913
parents 62ac4b24 fc0d6380
......@@ -94,6 +94,8 @@ export const handleLocationHash = () => {
const fixedNav = document.querySelector('.navbar-gitlab');
const performanceBar = document.querySelector('#js-peek');
const topPadding = 8;
const diffFileHeader = document.querySelector('.js-file-title');
const versionMenusContainer = document.querySelector('.mr-version-menus-container');
let adjustment = 0;
if (fixedNav) adjustment -= fixedNav.offsetHeight;
......@@ -114,6 +116,14 @@ export const handleLocationHash = () => {
adjustment -= performanceBar.offsetHeight;
}
if (diffFileHeader) {
adjustment -= diffFileHeader.offsetHeight;
}
if (versionMenusContainer) {
adjustment -= versionMenusContainer.offsetHeight;
}
if (isInMRPage()) {
adjustment -= topPadding;
}
......
---
title: Resolve Position is off when visiting files with anchors
merge_request: 28913
author:
type: fixed
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