blob: 0d77cf74bf019017c295f16b82781abda1a39d87 [file] [log] [blame]
import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
import CssSelectorNodeWatcherHandler from '../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
import CCInfiniteScroll from '../core/ccInfiniteScroll';
export default class CCInfiniteScrollSetUpHandler extends CssSelectorNodeWatcherHandler {
cssSelector = 'ec-app, .scrollable-content';
constructor(private ccInfiniteScroll: CCInfiniteScroll) {
super();
}
onMutatedNode({ node }: NodeMutation) {
if (!(node instanceof Element)) return;
const isScrollableContent = node.classList.contains('scrollable-content');
this.ccInfiniteScroll.setUpIntersectionObserver(node, isScrollableContent);
}
}