mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
alt+s toggles search instead of just showing it
This commit is contained in:
parent
7aff20bb0d
commit
0d3b3ec7c5
@ -8,14 +8,10 @@ const searchTree = (function() {
|
|||||||
|
|
||||||
resetSearchButton.click(resetSearch);
|
resetSearchButton.click(resetSearch);
|
||||||
|
|
||||||
function showSearch() {
|
|
||||||
searchBoxEl.show();
|
|
||||||
searchInputEl.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleSearch() {
|
function toggleSearch() {
|
||||||
if (searchBoxEl.is(":hidden")) {
|
if (searchBoxEl.is(":hidden")) {
|
||||||
showSearch();
|
searchBoxEl.show();
|
||||||
|
searchInputEl.focus();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resetSearch();
|
resetSearch();
|
||||||
@ -52,7 +48,11 @@ const searchTree = (function() {
|
|||||||
}
|
}
|
||||||
}).focus();
|
}).focus();
|
||||||
|
|
||||||
$(document).bind('keydown', 'alt+s', showSearch);
|
$(document).bind('keydown', 'alt+s', e => {
|
||||||
|
toggleSearch();
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
toggleSearch
|
toggleSearch
|
||||||
|
@ -67,7 +67,7 @@ router.delete('/:noteTreeId', auth.checkApiAuth, async (req, res, next) => {
|
|||||||
router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
router.get('/', auth.checkApiAuth, async (req, res, next) => {
|
||||||
const search = '%' + req.query.search + '%';
|
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 = [];
|
const noteIdList = [];
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="width: 500px; margin: auto;">
|
<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 class="alert alert-warning" id="alert" style="display: none;">
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user