mirror of
https://github.com/zadam/trilium.git
synced 2025-03-03 18:49:27 +08:00
focus and select title name for immediate change after creating new note
This commit is contained in:
parent
820768c572
commit
53aa563cdb
1 changed files with 10 additions and 0 deletions
|
@ -74,6 +74,8 @@ function createNewTopLevelNote() {
|
|||
createNote(rootNode, "root", "into");
|
||||
}
|
||||
|
||||
let newNoteCreated = false;
|
||||
|
||||
function createNote(node, parentKey, target) {
|
||||
let newNoteName = "new note";
|
||||
|
||||
|
@ -93,6 +95,8 @@ function createNote(node, parentKey, target) {
|
|||
"note_id": result.note_id
|
||||
};
|
||||
|
||||
newNoteCreated = true;
|
||||
|
||||
if (target == 'after') {
|
||||
node.appendSibling(newNode).setActive(true);
|
||||
}
|
||||
|
@ -114,6 +118,12 @@ function loadNote(noteId) {
|
|||
|
||||
$("#noteTitle").val(note.detail.note_title);
|
||||
|
||||
if (newNoteCreated) {
|
||||
newNoteCreated = false;
|
||||
|
||||
$("#noteTitle").focus().select();
|
||||
}
|
||||
|
||||
let noteText = notecase2html(note);
|
||||
|
||||
noteChangeDisabled = true;
|
||||
|
|
Loading…
Reference in a new issue