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