Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 1 | import { NodeMutation } from '../../../common/nodeWatcher/NodeWatcherHandler'; |
| 2 | import CssSelectorNodeWatcherScriptHandler from '../../../common/architecture/scripts/nodeWatcher/handlers/CssSelectorNodeWatcherScriptHandler'; |
| 3 | import { InfiniteScrollNodeWatcherOptions } from '../scripts/ccInfiniteScroll.script'; |
| 4 | |
| 5 | export default class CCInfiniteScrollLoadMoreBtnHandler extends CssSelectorNodeWatcherScriptHandler<InfiniteScrollNodeWatcherOptions> { |
| 6 | cssSelector = |
| 7 | '.scTailwindThreadMorebuttonbutton, .scTailwindThreadMessagegapbutton'; |
| 8 | |
| 9 | onMutatedNode({ node }: NodeMutation) { |
Adrià Vilanova Martínez | d45c04e | 2024-06-02 19:13:38 +0200 | [diff] [blame] | 10 | if (!(node instanceof Element)) { |
| 11 | console.error( |
| 12 | '[CCInfiniteScrollLoadMoreBtnHandler] Node is not an Element: ', |
| 13 | node, |
| 14 | ); |
| 15 | return; |
| 16 | } |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 17 | this.options.ccInfiniteScroll.observeLoadMoreInteropBtn(node); |
| 18 | } |
| 19 | } |