mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
Merge branch 'master' into next53
This commit is contained in:
@@ -24,8 +24,8 @@ async function createNote(parentNotePath, options = {}) {
|
||||
options.saveSelection = false;
|
||||
}
|
||||
|
||||
if (options.saveSelection && utils.isCKEditorInitialized()) {
|
||||
[options.title, options.content] = parseSelectedHtml(window.cutToNote.getSelectedHtml());
|
||||
if (options.saveSelection) {
|
||||
[options.title, options.content] = parseSelectedHtml(options.textEditor.getSelectedHtml());
|
||||
}
|
||||
|
||||
const parentNoteId = treeService.getNoteIdFromNotePath(parentNotePath);
|
||||
@@ -47,9 +47,9 @@ async function createNote(parentNotePath, options = {}) {
|
||||
templateNoteId: options.templateNoteId
|
||||
});
|
||||
|
||||
if (options.saveSelection && utils.isCKEditorInitialized()) {
|
||||
if (options.saveSelection) {
|
||||
// we remove the selection only after it was saved to server to make sure we don't lose anything
|
||||
window.cutToNote.removeSelection();
|
||||
options.textEditor.removeSelection();
|
||||
}
|
||||
|
||||
await ws.waitForMaxKnownEntityChangeId();
|
||||
|
||||
Reference in New Issue
Block a user