code cosmetics: use closest() in messageBox

This commit is contained in:
tophf 2017-12-17 21:57:26 +03:00
parent be20b5a8b4
commit 41f3103a16

View File

@ -40,10 +40,8 @@ function messageBox({
}
switch (which) {
case 13:
for (let el = target; el; el = el.parentElement) {
if (focusAccessibility.ELEMENTS.includes(el.localName)) {
return;
}
if (target.closest(focusAccessibility.ELEMENTS.join(','))) {
return;
}
break;
case 27: