mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
after creating new note, it is focused and now also selected so renaming is super easy, #318
This commit is contained in:
parent
2b32addade
commit
dffdb82288
@ -43,7 +43,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
|||||||
this.activateNewNote = async notePath => {
|
this.activateNewNote = async notePath => {
|
||||||
await treeService.reload();
|
await treeService.reload();
|
||||||
|
|
||||||
await treeService.activateNote(notePath, noteDetailService.focusOnTitle);
|
await treeService.activateNote(notePath, noteDetailService.focusAndSelectTitle);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,6 +283,10 @@ function focusOnTitle() {
|
|||||||
$noteTitle.focus();
|
$noteTitle.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function focusAndSelectTitle() {
|
||||||
|
$noteTitle.focus().select();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since detail loading may take some time and user might just browse through the notes using UP-DOWN keys,
|
* Since detail loading may take some time and user might just browse through the notes using UP-DOWN keys,
|
||||||
* we intentionally decouple activation of the note in the tree and full load of the note so just avaiting on
|
* we intentionally decouple activation of the note in the tree and full load of the note so just avaiting on
|
||||||
@ -342,6 +346,7 @@ export default {
|
|||||||
getCurrentNoteType,
|
getCurrentNoteType,
|
||||||
getCurrentNoteId,
|
getCurrentNoteId,
|
||||||
focusOnTitle,
|
focusOnTitle,
|
||||||
|
focusAndSelectTitle,
|
||||||
saveNote,
|
saveNote,
|
||||||
saveNoteIfChanged,
|
saveNoteIfChanged,
|
||||||
noteChanged,
|
noteChanged,
|
||||||
|
@ -588,7 +588,7 @@ async function createNote(node, parentNoteId, target, isProtected, saveSelection
|
|||||||
|
|
||||||
await noteDetailService.saveNoteIfChanged();
|
await noteDetailService.saveNoteIfChanged();
|
||||||
|
|
||||||
noteDetailService.addDetailLoadedListener(note.noteId, noteDetailService.focusOnTitle);
|
noteDetailService.addDetailLoadedListener(note.noteId, noteDetailService.focusAndSelectTitle);
|
||||||
|
|
||||||
const noteEntity = new NoteShort(treeCache, note);
|
const noteEntity = new NoteShort(treeCache, note);
|
||||||
const branchEntity = new Branch(treeCache, branch);
|
const branchEntity = new Branch(treeCache, branch);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user