mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
more refactoring
This commit is contained in:
26
static/js/jump_to_note.js
Normal file
26
static/js/jump_to_note.js
Normal file
@@ -0,0 +1,26 @@
|
||||
$(document).bind('keydown', 'alt+j', function() {
|
||||
$("#jumpToNoteAutocomplete").val('');
|
||||
|
||||
$("#jumpToNoteDialog").dialog({
|
||||
modal: true,
|
||||
width: 500
|
||||
});
|
||||
|
||||
$("#jumpToNoteAutocomplete").autocomplete({
|
||||
source: getAutocompleteItems(globalAllNoteIds),
|
||||
minLength: 0
|
||||
});
|
||||
});
|
||||
|
||||
$("#jumpToNoteForm").submit(function() {
|
||||
const val = $("#jumpToNoteAutocomplete").val();
|
||||
const noteId = getNodeIdFromLabel(val);
|
||||
|
||||
if (noteId) {
|
||||
getNodeByKey(noteId).setActive();
|
||||
|
||||
$("#jumpToNoteDialog").dialog('close');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
Reference in New Issue
Block a user