mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-25 14:38:29 -06:00
fix inserting current timestamp into editor
This commit is contained in:
@@ -85,9 +85,11 @@ function addLinkToEditor(linkTitle, linkHref) {
|
||||
|
||||
function addTextToEditor(text) {
|
||||
const editor = noteDetailText.getEditor();
|
||||
const doc = editor.document;
|
||||
|
||||
doc.enqueueChanges(() => editor.data.insertText(text), doc.selection);
|
||||
editor.model.change(writer => {
|
||||
const insertPosition = editor.model.document.selection.getFirstPosition();
|
||||
writer.insertText(text, insertPosition);
|
||||
});
|
||||
}
|
||||
|
||||
ko.bindingHandlers.noteLink = {
|
||||
|
||||
@@ -12,6 +12,10 @@ function getNodeByKey(key) {
|
||||
}
|
||||
|
||||
function getNoteIdFromNotePath(notePath) {
|
||||
if (!notePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const path = notePath.split("/");
|
||||
|
||||
return path[path.length - 1];
|
||||
|
||||
Reference in New Issue
Block a user