mirror of
https://github.com/9001/copyparty.git
synced 2025-08-24 04:12:24 -06:00
spacebar as actionkey when ok/cancel focused
This commit is contained in:
parent
1e846657d1
commit
88f77b8cca
|
@ -1057,15 +1057,22 @@ var modal = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onkey(e) {
|
function onkey(e) {
|
||||||
if (e.code == 'Enter') {
|
var k = e.code,
|
||||||
var a = ebi('modal-ng');
|
eok = ebi('modal-ok'),
|
||||||
if (a && document.activeElement == a)
|
eng = ebi('modal-ng'),
|
||||||
|
ae = document.activeElement;
|
||||||
|
|
||||||
|
if (k == 'Space' && ae && (ae === eok || ae === eng))
|
||||||
|
k = 'Enter';
|
||||||
|
|
||||||
|
if (k == 'Enter') {
|
||||||
|
if (ae && ae == eng)
|
||||||
return ng();
|
return ng();
|
||||||
|
|
||||||
return ok();
|
return ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.code == 'Escape')
|
if (k == 'Escape')
|
||||||
return ng();
|
return ng();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue