mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
immediately search on enter key
This commit is contained in:
parent
c73ff3ce1b
commit
3215afc504
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue