Merge branch '9721-cannot-scroll-forwards-in-time-for-roadmap-view-ce' into 'master'

CE Port of fix for roadmap forward timeline scroll

See merge request gitlab-org/gitlab-ce!25217
This commit is contained in:
Phil Hughes 2019-02-14 10:35:51 +00:00
commit 8becfd9092
2 changed files with 2 additions and 1 deletions

View File

@ -130,7 +130,7 @@ export const isInViewport = (el, offset = {}) => {
rect.top >= (top || 0) &&
rect.left >= (left || 0) &&
rect.bottom <= window.innerHeight &&
rect.right <= window.innerWidth
parseInt(rect.right, 10) <= window.innerWidth
);
};

View File

@ -855,6 +855,7 @@ describe('common_utils', () => {
});
it('returns true when provided `el` is in viewport', () => {
el.setAttribute('style', `position: absolute; right: ${window.innerWidth + 0.2};`);
document.body.appendChild(el);
expect(commonUtils.isInViewport(el)).toBe(true);