mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
feat(code): full-height background
This commit is contained in:
parent
19534c391f
commit
e10069a03e
@ -80,6 +80,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
show() {
|
show() {
|
||||||
this.$widget.show();
|
this.$widget.show();
|
||||||
|
this.#updateBackgroundColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
focus() {
|
focus() {
|
||||||
@ -97,6 +98,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
|||||||
this.codeEditor.setText("");
|
this.codeEditor.setText("");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this.#updateBackgroundColor("unset");
|
||||||
}
|
}
|
||||||
|
|
||||||
async executeWithCodeEditorEvent({ resolve, ntxId }: EventData<"executeWithCodeEditor">) {
|
async executeWithCodeEditorEvent({ resolve, ntxId }: EventData<"executeWithCodeEditor">) {
|
||||||
@ -117,6 +119,7 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
|||||||
if (theme) {
|
if (theme) {
|
||||||
await this.codeEditor.setTheme(theme);
|
await this.codeEditor.setTheme(theme);
|
||||||
}
|
}
|
||||||
|
this.#updateBackgroundColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,4 +128,9 @@ export default class AbstractCodeTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#updateBackgroundColor(color?: string) {
|
||||||
|
const $editorEl = $(this.codeEditor.dom);
|
||||||
|
this.$widget.closest(".scrolling-container").css("background-color", color ?? $editorEl.css("background-color"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user