MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / handleThemes

Method handleThemes

static/settings.ts:457–477  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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();

Callers 1

constructorMethod · 0.95

Calls 6

onThemeChangeMethod · 0.95
findMethod · 0.80
dataMethod · 0.80
valMethod · 0.80
unwrapStringFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected