Adrià Vilanova MartÃnez | 3c13a76 | 2024-11-09 23:03:32 +0100 | [diff] [blame^] | 1 | import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter'; |
| 2 | import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler'; |
| 3 | import FlattenThreads, { |
| 4 | kReplyActionButtonsSelector, |
| 5 | } from '../../core/flattenThreads'; |
| 6 | |
| 7 | /** Inject reply button in non-nested view */ |
| 8 | export default class FlattenThreadsReplyBtnHandler extends CssSelectorNodeWatcherHandler { |
| 9 | cssSelector = kReplyActionButtonsSelector; |
| 10 | |
| 11 | constructor(private flattenThreads: FlattenThreads) { |
| 12 | super(); |
| 13 | } |
| 14 | |
| 15 | onMutatedNode({ node }: NodeMutation) { |
| 16 | this.flattenThreads.injectReplyBtnIfApplicable(node); |
| 17 | } |
| 18 | } |