mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
immediately perform search if a checkbox is toggled
This commit is contained in:
parent
d0eb014c38
commit
a4239a466b
|
@ -5179,9 +5179,11 @@ document.onkeydown = function (e) {
|
||||||
|
|
||||||
function ev_search_input() {
|
function ev_search_input() {
|
||||||
var v = unsmart(this.value),
|
var v = unsmart(this.value),
|
||||||
id = this.getAttribute('id');
|
id = this.getAttribute('id'),
|
||||||
|
is_txt = id.slice(-1) == 'v',
|
||||||
|
is_chk = id.slice(-1) == 'c';
|
||||||
|
|
||||||
if (id.slice(-1) == 'v') {
|
if (is_txt) {
|
||||||
var chk = ebi(id.slice(0, -1) + 'c');
|
var chk = ebi(id.slice(0, -1) + 'c');
|
||||||
chk.checked = ((v + '').length > 0);
|
chk.checked = ((v + '').length > 0);
|
||||||
}
|
}
|
||||||
|
@ -5193,6 +5195,9 @@ document.onkeydown = function (e) {
|
||||||
cap = 125;
|
cap = 125;
|
||||||
|
|
||||||
clearTimeout(defer_timeout);
|
clearTimeout(defer_timeout);
|
||||||
|
if (is_chk)
|
||||||
|
return do_search();
|
||||||
|
|
||||||
defer_timeout = setTimeout(try_search, 2000);
|
defer_timeout = setTimeout(try_search, 2000);
|
||||||
try_search(v);
|
try_search(v);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue