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