mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
reorganization of source code
This commit is contained in:
28
public/javascripts/jump_to_note.js
Normal file
28
public/javascripts/jump_to_note.js
Normal file
@@ -0,0 +1,28 @@
|
||||
function showJumpToNote() {
|
||||
$("#jump-to-note-autocomplete").val('');
|
||||
|
||||
$("#jump-to-note-dialog").dialog({
|
||||
modal: true,
|
||||
width: 800
|
||||
});
|
||||
|
||||
$("#jump-to-note-autocomplete").autocomplete({
|
||||
source: getAutocompleteItems(globalAllNoteIds),
|
||||
minLength: 0
|
||||
});
|
||||
}
|
||||
|
||||
$(document).bind('keydown', 'alt+j', showJumpToNote);
|
||||
|
||||
$("#jump-to-note-form").submit(() => {
|
||||
const val = $("#jump-to-note-autocomplete").val();
|
||||
const noteId = getNodeIdFromLabel(val);
|
||||
|
||||
if (noteId) {
|
||||
getNodeByKey(noteId).setActive();
|
||||
|
||||
$("#jump-to-note-dialog").dialog('close');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
Reference in New Issue
Block a user