web/elements: fix flipped theme in codemirror (#4901)

This commit is contained in:
Jens L 2023-03-10 20:11:02 +01:00 committed by GitHub
parent 06fb81410b
commit e13615c1ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -131,7 +131,6 @@ export class AKElement extends LitElement {
} }
_activateTheme(root: AdoptedStyleSheetsElement, theme: UiThemeEnum) { _activateTheme(root: AdoptedStyleSheetsElement, theme: UiThemeEnum) {
console.log("activating theme", theme, this._activeTheme, this);
if (theme === this._activeTheme) { if (theme === this._activeTheme) {
return; return;
} }

View File

@ -150,7 +150,7 @@ export class CodeMirrorTextarea<T> extends AKElement {
EditorView.lineWrapping, EditorView.lineWrapping,
EditorState.readOnly.of(this.readOnly), EditorState.readOnly.of(this.readOnly),
EditorState.tabSize.of(2), EditorState.tabSize.of(2),
this.theme.of(this.activeTheme === UiThemeEnum.Dark ? this.themeLight : this.themeDark), this.theme.of(this.activeTheme === UiThemeEnum.Dark ? this.themeDark : this.themeLight),
]; ];
this.editor = new EditorView({ this.editor = new EditorView({
extensions: extensions.filter((p) => p) as Extension[], extensions: extensions.filter((p) => p) as Extension[],