editor: fix variable shadowing in let causing use before declaration

This commit is contained in:
Lephe 2022-04-27 10:51:52 +01:00
parent d9a5530d40
commit fa910ca77c
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 5 additions and 5 deletions

View File

@ -25,14 +25,14 @@ ta.addEventListener('keydown', function(e) {
e.target.selectionEnd = start + 1;
}
if (e.ctrlKey && keyCode == 13) {
let e = e.target;
while(! (e instanceof HTMLFormElement)) {
e = e.parentNode;
let t = e.target;
while(! (t instanceof HTMLFormElement)) {
t = t.parentNode;
}
try {
e.submit();
t.submit();
} catch(exception) {
e.submit.click();
t.submit.click();
}
}
});