mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 15:05:31 +08:00
close search button
This commit is contained in:
parent
385144451b
commit
e4d2513451
4 changed files with 21 additions and 6 deletions
BIN
src/public/images/icons/search-20.png
Normal file
BIN
src/public/images/icons/search-20.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 431 B |
BIN
src/public/images/icons/x.png
Normal file
BIN
src/public/images/icons/x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 259 B |
|
@ -10,21 +10,26 @@ const $saveSearchButton = $("#save-search-button");
|
||||||
const $searchBox = $("#search-box");
|
const $searchBox = $("#search-box");
|
||||||
const $searchResults = $("#search-results");
|
const $searchResults = $("#search-results");
|
||||||
const $searchResultsInner = $("#search-results-inner");
|
const $searchResultsInner = $("#search-results-inner");
|
||||||
|
const $closeSearchButton = $("#close-search-button");
|
||||||
|
|
||||||
function showSearch() {
|
function showSearch() {
|
||||||
$searchBox.show();
|
$searchBox.show();
|
||||||
$searchInput.focus();
|
$searchInput.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function hideSearch() {
|
||||||
|
resetSearch();
|
||||||
|
|
||||||
|
$searchResults.hide();
|
||||||
|
$searchBox.hide();
|
||||||
|
}
|
||||||
|
|
||||||
function toggleSearch() {
|
function toggleSearch() {
|
||||||
if ($searchBox.is(":hidden")) {
|
if ($searchBox.is(":hidden")) {
|
||||||
showSearch();
|
showSearch();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resetSearch();
|
hideSearch();
|
||||||
|
|
||||||
$searchResults.hide();
|
|
||||||
$searchBox.hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +94,8 @@ $resetSearchButton.click(resetSearch);
|
||||||
|
|
||||||
$saveSearchButton.click(saveSearch);
|
$saveSearchButton.click(saveSearch);
|
||||||
|
|
||||||
|
$closeSearchButton.click(hideSearch);
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
toggleSearch,
|
toggleSearch,
|
||||||
resetSearch,
|
resetSearch,
|
||||||
|
|
|
@ -76,13 +76,21 @@
|
||||||
<div id="search-box" style="display: none; padding: 10px; margin-top: 10px;">
|
<div id="search-box" style="display: none; padding: 10px; margin-top: 10px;">
|
||||||
<div style="display: flex; align-items: center;">
|
<div style="display: flex; align-items: center;">
|
||||||
<input name="search-text" placeholder="Search text, labels" style="flex-grow: 100; margin-left: 5px; margin-right: 5px;" autocomplete="off">
|
<input name="search-text" placeholder="Search text, labels" style="flex-grow: 100; margin-left: 5px; margin-right: 5px;" autocomplete="off">
|
||||||
<button id="do-search-button" class="btn btn-sm" title="Search">Search</button>
|
<button id="do-search-button" class="btn btn-sm" title="Search (enter)" style="padding: 4px;">
|
||||||
|
<img src="/images/icons/search-20.png" alt="Search"/>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button id="save-search-button" class="btn btn-sm" title="Save search" style="padding: 4px;">
|
<button id="save-search-button" class="btn btn-sm" title="Save search" style="padding: 4px;">
|
||||||
<img src="/images/icons/save.png" alt="Save search"/>
|
<img src="/images/icons/save.png" alt="Save search"/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<button id="close-search-button" class="btn btn-sm" title="Close search" style="padding: 4px;">
|
||||||
|
<img src="/images/icons/x.png" alt="Close search"/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -318,7 +326,7 @@
|
||||||
<div style="display: flex; justify-content: space-between;">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<button id="jump-to-note-button" class="btn btn-sm btn-primary">Jump <kbd>enter</kbd></button>
|
<button id="jump-to-note-button" class="btn btn-sm btn-primary">Jump <kbd>enter</kbd></button>
|
||||||
|
|
||||||
<button id="show-in-full-text-button" class="btn btn-sm"><< Show results in full text <kbd>ctrl+enter</kbd></button>
|
<button id="show-in-full-text-button" class="btn btn-sm">Search in full text <kbd>ctrl+enter</kbd></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue