1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-11-27 22:38:10 +02:00

Improve scroll detection compatibility

This commit is contained in:
Patrik J. Braun
2025-09-30 23:32:00 +02:00
parent 443ed181c4
commit aacc53fd05

View File

@@ -447,14 +447,12 @@ export class GalleryGridComponent
*/ */
private shouldRenderMore(offset = 0): boolean { private shouldRenderMore(offset = 0): boolean {
const bottomOffset = this.getMaxRowHeight() * 2; const bottomOffset = this.getMaxRowHeight() * 2;
const maxScroll = PageHelper.MaxScrollY + offset;
return ( return (
Config.Gallery.enableOnScrollRendering === false || Config.Gallery.enableOnScrollRendering === false ||
PageHelper.ScrollY >= PageHelper.ScrollY >= maxScroll - bottomOffset ||
document.body.clientHeight + maxScroll * 0.85 < window.innerHeight
offset -
window.innerHeight -
bottomOffset ||
(document.body.clientHeight + offset) * 0.85 < window.innerHeight
); );
} }