diff --git a/Web/pwa-app b/Web/pwa-app deleted file mode 160000 index da45c25..0000000 --- a/Web/pwa-app +++ /dev/null @@ -1 +0,0 @@ -Subproject commit da45c250396ca827471e0cd92ed5d192fb2171ec diff --git a/Web/templates/main.html b/Web/templates/main.html index 9eacd98..c61bc9f 100755 --- a/Web/templates/main.html +++ b/Web/templates/main.html @@ -781,10 +781,10 @@ styles.flexDirection === 'column'; const distanceToEnd = isMobileLayout - ? itemsContainer.scrollHeight - (itemsContainer.scrollTop + itemsContainer.clientHeight) + ? Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) - (window.scrollY + window.innerHeight) : itemsContainer.scrollWidth - (itemsContainer.scrollLeft + itemsContainer.clientWidth); const prefetchThreshold = isMobileLayout - ? Math.max(220, itemsContainer.clientHeight * 0.9) + ? window.innerHeight * 1.5 : Math.max(260, itemsContainer.clientWidth * 1.4); if (distanceToEnd > prefetchThreshold) { return; @@ -1167,6 +1167,7 @@ if (!mainItemsScrollPrefetchBound) { itemsContainer.addEventListener('scroll', maybePrefetchMainItems, { passive: true }); + window.addEventListener('scroll', maybePrefetchMainItems, { passive: true }); mainItemsScrollPrefetchBound = true; } @@ -1188,7 +1189,7 @@ updateMainItemsLoadingIndicator(); }); }, { - root: itemsContainer, + root: isMobileLayout ? null : itemsContainer, threshold: 0.15, rootMargin: isMobileLayout ? '0px 0px 900px 0px' : '0px 900px 0px 0px' }); diff --git a/Web/templates/main_admin.html b/Web/templates/main_admin.html index d3456b1..5875fcd 100755 --- a/Web/templates/main_admin.html +++ b/Web/templates/main_admin.html @@ -3397,10 +3397,10 @@ document.addEventListener('DOMContentLoaded', ()=>{ styles.flexDirection === 'column'; const distanceToEnd = isMobileLayout - ? itemsContainer.scrollHeight - (itemsContainer.scrollTop + itemsContainer.clientHeight) + ? Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) - (window.scrollY + window.innerHeight) : itemsContainer.scrollWidth - (itemsContainer.scrollLeft + itemsContainer.clientWidth); const prefetchThreshold = isMobileLayout - ? Math.max(220, itemsContainer.clientHeight * 0.9) + ? window.innerHeight * 1.5 : Math.max(260, itemsContainer.clientWidth * 1.4); if (distanceToEnd > prefetchThreshold) { return; @@ -3772,6 +3772,7 @@ document.addEventListener('DOMContentLoaded', ()=>{ if (!mainAdminItemsScrollPrefetchBound) { itemsContainer.addEventListener('scroll', maybePrefetchMainAdminItems, { passive: true }); + window.addEventListener('scroll', maybePrefetchMainAdminItems, { passive: true }); mainAdminItemsScrollPrefetchBound = true; } @@ -3793,7 +3794,7 @@ document.addEventListener('DOMContentLoaded', ()=>{ updateMainAdminItemsLoadingIndicator(); }); }, { - root: itemsContainer, + root: isMobileLayout ? null : itemsContainer, threshold: 0.15, rootMargin: isMobileLayout ? '0px 0px 900px 0px' : '0px 900px 0px 0px' });