Commit 06c31e08 authored by Thomas Randolph's avatar Thomas Randolph

Include the "resolve all container" height in contentTop

parent 37f11976
......@@ -218,26 +218,35 @@ export const isMetaKey = e => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
export const isMetaClick = e => e.metaKey || e.ctrlKey || e.which === 2;
export const contentTop = () => {
const isDesktop = breakpointInstance.isDesktop();
const heightCalculators = [
() => $('#js-peek').outerHeight(),
() => $('.navbar-gitlab').outerHeight(),
({ desktop }) => {
let size = 0;
if (!desktop) {
size = document.querySelector('.line-resolve-all-container').offsetHeight;
}
return size;
},
() => $('.merge-request-tabs').outerHeight(),
() => $('.js-diff-files-changed').outerHeight(),
() => {
const isDesktop = breakpointInstance.isDesktop();
({ desktop }) => {
const diffsTabIsActive = window.mrTabs?.currentAction === 'diffs';
let size;
if (isDesktop && diffsTabIsActive) {
if (desktop && diffsTabIsActive) {
size = $('.diff-file .file-title-flex-parent:visible').outerHeight();
}
return size;
},
() => {
({ desktop }) => {
let size;
if (breakpointInstance.isDesktop()) {
if (desktop) {
size = $('.mr-version-controls').outerHeight();
}
......@@ -246,7 +255,7 @@ export const contentTop = () => {
];
return heightCalculators.reduce((totalHeight, calculator) => {
return totalHeight + (calculator() || 0);
return totalHeight + (calculator({ desktop: isDesktop }) || 0);
}, 0);
};
......
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