()
| 455 | } |
| 456 | |
| 457 | private handleThemes() { |
| 458 | const themeSelect = this.root.find('.theme'); |
| 459 | themeSelect.on('change', () => { |
| 460 | this.onThemeChange(); |
| 461 | $.data(themeSelect, 'last-theme', unwrapString(themeSelect.val())); |
| 462 | }); |
| 463 | |
| 464 | const colourSchemeSelect = this.root.find('.colourScheme'); |
| 465 | colourSchemeSelect.on('change', _e => { |
| 466 | const currentTheme = this.settings.theme; |
| 467 | $.data(themeSelect, 'theme-' + currentTheme, unwrapString<ColourScheme>(colourSchemeSelect.val())); |
| 468 | }); |
| 469 | |
| 470 | const enableAllSchemesCheckbox = this.root.find('.alwaysEnableAllSchemes'); |
| 471 | enableAllSchemesCheckbox.on('change', this.onThemeChange.bind(this)); |
| 472 | |
| 473 | // In embed mode themeSelect.length can be zero and thus themeSelect.val() isn't a string |
| 474 | // TODO(jeremy-rifkin) Is last-theme ever read? Can it just be removed? |
| 475 | $.data(themeSelect, 'last-theme', themeSelect.val() ?? ''); |
| 476 | this.onThemeChange(); |
| 477 | } |
| 478 | |
| 479 | private fillColourSchemeSelector(colourSchemeSelect: JQuery, theme?: AppTheme) { |
| 480 | colourSchemeSelect.empty(); |
no test coverage detected