Commit 853b7ea2 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'defect/resolve-all-scroll-height' into 'master'

Mobile MR diffs overscroll problem

See merge request gitlab-org/gitlab!48091
parents c6e7be4d 81cf4370
...@@ -218,26 +218,36 @@ export const isMetaKey = e => e.metaKey || e.ctrlKey || e.altKey || e.shiftKey; ...@@ -218,26 +218,36 @@ 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 }) => {
const container = document.querySelector('.line-resolve-all-container');
let size = 0;
if (!desktop && container) {
size = 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 +256,7 @@ export const contentTop = () => { ...@@ -246,7 +256,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);
}; };
......
---
title: Fix overscroll for MR diffs in mobile view
merge_request: 48091
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