mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
added incremental search
This commit is contained in:
parent
fa557e5f76
commit
1e25fffc70
@ -134,9 +134,13 @@
|
||||
<div class="modal-content" id="globalSearchModalContent">
|
||||
<div class="modal-body">
|
||||
<div class="input-group input-group-lg">
|
||||
<input type="text" id="globalSearchInput" onkeyup="handleGlobalSearchKeyPress(event)" class="form-control" placeholder="@translator.Translate(userLanguage,"Search by Keyword(Case Sensitive)")">
|
||||
<input type="text" id="globalSearchInput" autocomplete="off" onkeyup="handleGlobalSearchKeyPress(event)" class="form-control" placeholder="@translator.Translate(userLanguage,"Search by Keyword(Case Sensitive)")">
|
||||
<button type="button" class="btn btn-outline-secondary" onclick="performGlobalSearch()"><i class="bi bi-search"></i></button>
|
||||
</div>
|
||||
<div class="form-check form-switch mt-1">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="globalSearchAutoSearchCheck" checked>
|
||||
<label class="form-check-label" for="globalSearchAutoSearchCheck">@translator.Translate(userLanguage, "Incremental Search")</label>
|
||||
</div>
|
||||
<div id="globalSearchModalResults"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -159,7 +159,9 @@ function performGlobalSearch() {
|
||||
});
|
||||
}
|
||||
function handleGlobalSearchKeyPress(event) {
|
||||
if (event.keyCode == 13) {
|
||||
if ($('#globalSearchAutoSearchCheck').is(':checked')){
|
||||
setDebounce(performGlobalSearch);
|
||||
} else if (event.keyCode == 13) {
|
||||
performGlobalSearch();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user