immediately search on enter key

This commit is contained in:
ed 2022-04-28 22:53:37 +02:00
parent c73ff3ce1b
commit 3215afc504

View file

@ -3319,6 +3319,7 @@ document.onkeydown = function (e) {
var o = QSA('#op_search input');
for (var a = 0; a < o.length; a++) {
o[a].oninput = ev_search_input;
o[a].onkeydown = ev_search_keydown;
}
function srch_msg(err, txt) {
@ -3351,6 +3352,11 @@ document.onkeydown = function (e) {
try_search(v);
}
function ev_search_keydown(e) {
if (e.key == 'Enter')
do_search();
}
function try_search(v) {
if (Date.now() - search_in_progress > 30 * 1000) {
clearTimeout(defer_timeout);