blob: b36e0b9267318a4dc90180fa8fab738ed004fa68 [file] [log] [blame]
import { NodeMutation } from '../../../presentation/nodeWatcher/NodeWatcherHandler';
import CssSelectorNodeWatcherScriptHandler from '../../../common/architecture/scripts/nodeWatcher/handlers/CssSelectorNodeWatcherScriptHandler';
import { InfiniteScrollNodeWatcherOptions } from '../scripts/ccInfiniteScroll.script';
export default class CCInfiniteScrollSetUpHandler extends CssSelectorNodeWatcherScriptHandler<InfiniteScrollNodeWatcherOptions> {
cssSelector = 'ec-app, .scrollable-content';
onMutatedNode({ node }: NodeMutation) {
if (!(node instanceof Element)) return;
const isScrollableContent = node.classList.contains('scrollable-content');
this.options.ccInfiniteScroll.setUpIntersectionObserver(
node,
isScrollableContent,
);
}
}