more refactoring

This commit is contained in:
azivner
2017-09-09 12:34:20 -04:00
parent aad90f016b
commit 42c21afa62
10 changed files with 102 additions and 93 deletions

26
static/js/jump_to_note.js Normal file
View 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;
});