diff --git a/static/js/init.js b/static/js/init.js index 928ec8629..ffc90ec43 100644 --- a/static/js/init.js +++ b/static/js/init.js @@ -42,15 +42,23 @@ $(document).bind('keypress', 'alt+q', function() { }); }); +function setActiveNoteBasedOnRecentNotes() { + let noteId = $("#recentNotesSelectBox option:selected").val(); + + $("#tree").fancytree('getNodeByKey', noteId).setActive(); + + $("#recentNotesDialog").dialog('close'); +} + $('#recentNotesSelectBox').keydown(function(e) { let key = e.which; if (key === 13)// the enter key code { - let noteId = $("#recentNotesSelectBox option:selected").val(); - - $("#tree").fancytree('getNodeByKey', noteId).setActive(); - - $("#recentNotesDialog").dialog('close'); + setActiveNoteBasedOnRecentNotes(); } +}); + +$('#recentNotesSelectBox').dblclick(function(e) { + setActiveNoteBasedOnRecentNotes(); }); \ No newline at end of file