Adrià Vilanova MartÃnez | fe69478 | 2024-11-09 20:40:43 +0100 | [diff] [blame] | 1 | import CssSelectorNodeWatcherHandler from '../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter'; |
| 2 | import { NodeMutation } from '../../../../presentation/nodeWatcher/NodeWatcherHandler'; |
| 3 | import { OptionsProviderPort } from '../../../../services/options/OptionsProvider'; |
| 4 | import ReportDialogColorThemeFix from '../../core/logic/reportDialog'; |
| 5 | |
| 6 | /** |
| 7 | * Sets the report dialog iframe's theme to the appropriate theme. |
| 8 | */ |
| 9 | export default class CCDarkThemeReportDialogHandler extends CssSelectorNodeWatcherHandler { |
| 10 | cssSelector = 'iframe'; |
| 11 | |
| 12 | constructor( |
| 13 | private optionsProvider: OptionsProviderPort, |
| 14 | private reportDialogColorThemeFix: ReportDialogColorThemeFix, |
| 15 | ) { |
| 16 | super(); |
| 17 | } |
| 18 | |
| 19 | onMutatedNode(mutation: NodeMutation) { |
| 20 | this.reportDialogColorThemeFix.fixThemeIfReportDialogIframeAndApplicable( |
| 21 | mutation.node, |
| 22 | this.optionsProvider, |
| 23 | ); |
| 24 | } |
| 25 | } |