Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 844fb3c

Browse files
committed
refactor(client): use different approach for disabling code background
1 parent e29e711 commit 844fb3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

apps/client/src/widgets/type_widgets/abstract_code_type_widget.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
8080

8181
show() {
8282
this.$widget.show();
83-
this.#updateBackgroundColor();
83+
this.updateBackgroundColor();
8484
}
8585

8686
focus() {
@@ -98,7 +98,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
9898
this.codeEditor.setText("");
9999
});
100100
}
101-
this.#updateBackgroundColor("unset");
101+
this.updateBackgroundColor("unset");
102102
}
103103

104104
async executeWithCodeEditorEvent({ resolve, ntxId }: EventData<"executeWithCodeEditor">) {
@@ -119,7 +119,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
119119
if (theme) {
120120
await this.codeEditor.setTheme(theme);
121121
}
122-
this.#updateBackgroundColor();
122+
this.updateBackgroundColor();
123123
}
124124
}
125125

@@ -128,7 +128,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
128128
}
129129
}
130130

131-
#updateBackgroundColor(color?: string) {
131+
updateBackgroundColor(color?: string) {
132132
const $editorEl = $(this.codeEditor.dom);
133133
this.$widget.closest(".scrolling-container").css("background-color", color ?? $editorEl.css("background-color"));
134134
}

apps/client/src/widgets/type_widgets/abstract_split_type_widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const TPL = /*html*/`\
3434
3535
.note-detail-split-preview-col {
3636
position: relative;
37-
background: var(--main-background-color);
3837
}
3938
4039
.note-detail-split .note-detail-split-editor {
@@ -132,6 +131,7 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
132131
constructor() {
133132
super();
134133
this.editorTypeWidget = new EditableCodeTypeWidget();
134+
this.editorTypeWidget.updateBackgroundColor = () => {};
135135
this.editorTypeWidget.isEnabled = () => true;
136136

137137
const defaultOptions = this.editorTypeWidget.getExtraOpts();

0 commit comments

Comments
 (0)