blob: ad6e153076e72dd717a598b52c81608440945259 [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);
}
}