mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
nest code editor instance to avoid visibility issues
This commit is contained in:
parent
e5036318af
commit
bf3360572a
@ -14,6 +14,7 @@ class NoteDetailCode {
|
|||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
this.codeEditor = null;
|
this.codeEditor = null;
|
||||||
this.$component = ctx.$tabContent.find('.note-detail-code');
|
this.$component = ctx.$tabContent.find('.note-detail-code');
|
||||||
|
this.$editorEl = this.$component.find('.note-detail-code-editor');
|
||||||
this.$executeScriptButton = ctx.$tabContent.find(".execute-script-button");
|
this.$executeScriptButton = ctx.$tabContent.find(".execute-script-button");
|
||||||
|
|
||||||
utils.bindElShortcut(ctx.$tabContent, "ctrl+return", () => this.executeCurrentNote());
|
utils.bindElShortcut(ctx.$tabContent, "ctrl+return", () => this.executeCurrentNote());
|
||||||
@ -34,7 +35,7 @@ class NoteDetailCode {
|
|||||||
|
|
||||||
CodeMirror.modeURL = 'libraries/codemirror/mode/%N/%N.js';
|
CodeMirror.modeURL = 'libraries/codemirror/mode/%N/%N.js';
|
||||||
|
|
||||||
this.codeEditor = CodeMirror(this.$component[0], {
|
this.codeEditor = CodeMirror(this.$editorEl[0], {
|
||||||
value: "",
|
value: "",
|
||||||
viewportMargin: Infinity,
|
viewportMargin: Infinity,
|
||||||
indentUnit: 4,
|
indentUnit: 4,
|
||||||
|
@ -357,10 +357,13 @@ div.ui-tooltip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.note-detail-code {
|
.note-detail-code {
|
||||||
min-height: 200px;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note-detail-code-editor {
|
||||||
|
min-height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
.note-detail-render {
|
.note-detail-render {
|
||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,9 @@
|
|||||||
<div class="note-detail-text-editor" tabindex="10000"></div>
|
<div class="note-detail-text-editor" tabindex="10000"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-detail-code note-detail-component"></div>
|
<div class="note-detail-code note-detail-component">
|
||||||
|
<div class="note-detail-code-editor"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% include details/empty.ejs %>
|
<% include details/empty.ejs %>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user