diff --git a/public/javascripts/search_tree.js b/public/javascripts/search_tree.js index 38e85d39c..fe4b13442 100644 --- a/public/javascripts/search_tree.js +++ b/public/javascripts/search_tree.js @@ -8,14 +8,10 @@ const searchTree = (function() { resetSearchButton.click(resetSearch); - function showSearch() { - searchBoxEl.show(); - searchInputEl.focus(); - } - function toggleSearch() { if (searchBoxEl.is(":hidden")) { - showSearch(); + searchBoxEl.show(); + searchInputEl.focus(); } else { resetSearch(); @@ -52,7 +48,11 @@ const searchTree = (function() { } }).focus(); - $(document).bind('keydown', 'alt+s', showSearch); + $(document).bind('keydown', 'alt+s', e => { + toggleSearch(); + + e.preventDefault(); + }); return { toggleSearch diff --git a/routes/api/notes.js b/routes/api/notes.js index 1c4ce2fd8..4aa7bc4af 100644 --- a/routes/api/notes.js +++ b/routes/api/notes.js @@ -67,7 +67,7 @@ router.delete('/:noteTreeId', auth.checkApiAuth, async (req, res, next) => { router.get('/', auth.checkApiAuth, async (req, res, next) => { const search = '%' + req.query.search + '%'; - const result = await sql.getAll("SELECT note_id FROM notes WHERE note_title liKE ? OR note_text LIKE ?", [search, search]); + const result = await sql.getAll("SELECT note_id FROM notes WHERE note_title LIKE ? OR note_text LIKE ?", [search, search]); const noteIdList = []; diff --git a/views/setup.ejs b/views/setup.ejs index 416a9fd00..6a039fdda 100644 --- a/views/setup.ejs +++ b/views/setup.ejs @@ -6,7 +6,7 @@