mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix ctrl+enter in sql console
This commit is contained in:
parent
233a50dbb7
commit
24a3f814ed
@ -50,11 +50,7 @@ async function initEditor() {
|
|||||||
codeEditor.focus();
|
codeEditor.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function execute(e) {
|
async function execute() {
|
||||||
// stop from propagating upwards (dangerous especially with ctrl+enter executable javascript notes)
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
|
|
||||||
// execute the selected text or the whole content if there's no selection
|
// execute the selected text or the whole content if there's no selection
|
||||||
let sqlQuery = codeEditor.getSelection();
|
let sqlQuery = codeEditor.getSelection();
|
||||||
|
|
||||||
|
@ -141,9 +141,10 @@ function bindElShortcut($el, keyboardShortcut, handler) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$el.bind('keydown', keyboardShortcut, e => {
|
$el.bind('keydown', keyboardShortcut, e => {
|
||||||
handler();
|
handler(e);
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,10 @@ function getParams(params) {
|
|||||||
async function getScriptBundleForFrontend(note) {
|
async function getScriptBundleForFrontend(note) {
|
||||||
const bundle = await getScriptBundle(note);
|
const bundle = await getScriptBundle(note);
|
||||||
|
|
||||||
|
if (!bundle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// for frontend we return just noteIds because frontend needs to use its own entity instances
|
// for frontend we return just noteIds because frontend needs to use its own entity instances
|
||||||
bundle.noteId = bundle.note.noteId;
|
bundle.noteId = bundle.note.noteId;
|
||||||
delete bundle.note;
|
delete bundle.note;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user