Adrià Vilanova Martínez | fe69478 | 2024-11-09 20:40:43 +0100 | [diff] [blame] | 1 | import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler'; |
| 2 | import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter'; |
| 3 | import CCInfiniteScroll from '../../core/ccInfiniteScroll'; |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 4 | |
Adrià Vilanova Martínez | 7c941c7 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 5 | export default class CCInfiniteScrollLoadMoreBtnHandler extends CssSelectorNodeWatcherHandler { |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 6 | cssSelector = |
| 7 | '.scTailwindThreadMorebuttonbutton, .scTailwindThreadMessagegapbutton'; |
| 8 | |
Adrià Vilanova Martínez | 7c941c7 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 9 | constructor(private ccInfiniteScroll: CCInfiniteScroll) { |
| 10 | super(); |
| 11 | } |
| 12 | |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 13 | onMutatedNode({ node }: NodeMutation) { |
Adrià Vilanova Martínez | d45c04e | 2024-06-02 19:13:38 +0200 | [diff] [blame] | 14 | if (!(node instanceof Element)) { |
| 15 | console.error( |
| 16 | '[CCInfiniteScrollLoadMoreBtnHandler] Node is not an Element: ', |
| 17 | node, |
| 18 | ); |
| 19 | return; |
| 20 | } |
Adrià Vilanova Martínez | 7c941c7 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 21 | this.ccInfiniteScroll.observeLoadMoreInteropBtn(node); |
Adrià Vilanova Martínez | 18d03c4 | 2024-04-21 16:43:01 +0200 | [diff] [blame] | 22 | } |
| 23 | } |