|
@@ -167,21 +167,24 @@
|
|
|
if (!keepZoomLevel) {
|
|
if (!keepZoomLevel) {
|
|
|
dispatchResizeEvent();
|
|
dispatchResizeEvent();
|
|
|
const docBoundingRect = scrollingElement.getBoundingClientRect();
|
|
const docBoundingRect = scrollingElement.getBoundingClientRect();
|
|
|
- [...observers].forEach(([intersectionObserver, observer]) => {
|
|
|
|
|
- const getBoundingClientRectDefined = observer.options && observer.options.root && observer.options.root.getBoundingClientRect;
|
|
|
|
|
- const rootBoundingRect = getBoundingClientRectDefined && observer.options.root.getBoundingClientRect();
|
|
|
|
|
- const targetElements = observedElements.get(intersectionObserver);
|
|
|
|
|
- if (targetElements) {
|
|
|
|
|
- observer.callback(targetElements.map(target => {
|
|
|
|
|
- const boundingClientRect = target.getBoundingClientRect();
|
|
|
|
|
- const isIntersecting = true;
|
|
|
|
|
- const intersectionRatio = 1;
|
|
|
|
|
- const rootBounds = getBoundingClientRectDefined ? rootBoundingRect : docBoundingRect;
|
|
|
|
|
- const time = 0;
|
|
|
|
|
- return { target, intersectionRatio, boundingClientRect, intersectionRect: boundingClientRect, isIntersecting, rootBounds, time };
|
|
|
|
|
- }), intersectionObserver);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (window == window.top) {
|
|
|
|
|
+ [...observers].forEach(([intersectionObserver, observer]) => {
|
|
|
|
|
+ const getBoundingClientRectDefined = observer.options && observer.options.root && observer.options.root.getBoundingClientRect;
|
|
|
|
|
+ const rootBoundingRect = getBoundingClientRectDefined && observer.options.root.getBoundingClientRect();
|
|
|
|
|
+ const targetElements = observedElements.get(intersectionObserver);
|
|
|
|
|
+ if (targetElements) {
|
|
|
|
|
+ const params = targetElements.map(target => {
|
|
|
|
|
+ const boundingClientRect = target.getBoundingClientRect();
|
|
|
|
|
+ const isIntersecting = true;
|
|
|
|
|
+ const intersectionRatio = 1;
|
|
|
|
|
+ const rootBounds = getBoundingClientRectDefined ? rootBoundingRect : docBoundingRect;
|
|
|
|
|
+ const time = 0;
|
|
|
|
|
+ return { target, intersectionRatio, boundingClientRect, intersectionRect: boundingClientRect, isIntersecting, rootBounds, time };
|
|
|
|
|
+ });
|
|
|
|
|
+ observer.callback(params, intersectionObserver);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|