Fix: isOutOfViewport calculation of the block bottom for sticky mode (montage.js)

This commit is contained in:
IgorA100
2024-09-23 11:47:24 +03:00
committed by GitHub
parent da4636d11d
commit d53c509e73

View File

@@ -862,7 +862,7 @@ function isOutOfViewport(elem) {
const out = {};
out.top = (bounding.top < headerHeight) || ( bounding.top > (window.innerHeight || document.documentElement.clientHeight) );
out.left = (bounding.left < 0) || (bounding.left > (window.innerWidth || document.documentElement.clientWidth));
out.bottom = (bounding.bottom > (window.innerHeight-headerHeight || document.documentElement.clientHeight-headerHeight) ) || (bounding.bottom < 0);
out.bottom = (bounding.bottom > (window.innerHeight-headerHeight || document.documentElement.clientHeight-headerHeight) ) || (bounding.bottom < headerHeight);
out.right = (bounding.right > (window.innerWidth || document.documentElement.clientWidth) ) || (bounding.right < 0);
out.any = out.top || out.left || out.bottom || out.right;
out.all = (out.top && out.bottom ) || (out.left && out.right);