nodebb-plugin-ezoic-infinite 1.6.71 → 1.6.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/client.js +11 -4
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -1092,11 +1092,18 @@ function buildOrdinalMap(items) {
|
|
|
1092
1092
|
if (!el) continue;
|
|
1093
1093
|
if (!el || !el.isConnected) continue;
|
|
1094
1094
|
|
|
1095
|
-
// Viewport guard:
|
|
1096
|
-
//
|
|
1097
|
-
//
|
|
1095
|
+
// Viewport guard (loose): NodeBB may load batches above the fold when the user scrolls up.
|
|
1096
|
+
// If we inject immediately into anchors that are *far* above the viewport, wraps tend to
|
|
1097
|
+
// accumulate/pile near the top once the DOM is recycled.
|
|
1098
|
+
//
|
|
1099
|
+
// Important: do NOT skip when the anchor is only slightly above the viewport (e.g. -10px),
|
|
1100
|
+
// otherwise injection feels "missing" compared to v17. We only skip when it's well above.
|
|
1098
1101
|
try {
|
|
1099
|
-
if (scrollDir < 0
|
|
1102
|
+
if (scrollDir < 0) {
|
|
1103
|
+
const bottom = el.getBoundingClientRect().bottom;
|
|
1104
|
+
const cutoff = -Math.max(240, (window.innerHeight || 800) * 0.75);
|
|
1105
|
+
if (bottom < cutoff) continue;
|
|
1106
|
+
}
|
|
1100
1107
|
} catch (e) {}
|
|
1101
1108
|
|
|
1102
1109
|
if (isAdjacentAd(el)) continue;
|