blob: e9f04ffee8c52aed63b08859b6263a398bf33410 [file] [log] [blame]
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +02001import { NodeMutation } from '../../../common/nodeWatcher/NodeWatcherHandler';
2import CssSelectorNodeWatcherScriptHandler from '../../../common/architecture/scripts/nodeWatcher/handlers/CssSelectorNodeWatcherScriptHandler';
3import { InfiniteScrollNodeWatcherOptions } from '../scripts/ccInfiniteScroll.script';
4
5export default class CCInfiniteScrollLoadMoreBarHandler extends CssSelectorNodeWatcherScriptHandler<InfiniteScrollNodeWatcherOptions> {
6 cssSelector = '.load-more-bar';
7
8 onMutatedNode({ node }: NodeMutation) {
Adrià Vilanova Martínezd45c04e2024-06-02 19:13:38 +02009 if (!(node instanceof Element)) {
10 console.error(
11 '[CCInfiniteScrollLoadMoreBarHandler] Node is not an Element: ',
12 node,
13 );
14 return;
15 }
Adrià Vilanova Martínez18d03c42024-04-21 16:43:01 +020016 this.options.ccInfiniteScroll.observeLoadMoreBar(node);
17 }
18}