Skip to content

Build your personal knowledge base with Trilium Notes

alt+s toggles search instead of just showing it

azivner0d3b3ec7c5ea
diff --git a/public/javascripts/search_tree.js b/public/javascripts/search_tree.js
index 38e85d39c8..fe4b134423 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 1c4ce2fd82..4aa7bc4af4 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 416a9fd00d..6a039fdda5 100644
--- a/views/setup.ejs
+++ b/views/setup.ejs
@@ -6,7 +6,7 @@
</head>
<body>
<div style="width: 500px; margin: auto;">
- <h1>Trilium setup</h1>
+ <h1>Trilium Notes setup</h1>
<div class="alert alert-warning" id="alert" style="display: none;">
</div>