1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 08:34:20 +02:00

JS: Simplify onbeforeunload

This commit is contained in:
Jakub Vrana
2025-03-21 23:19:31 +01:00
parent 7fca87dfd7
commit 5aedb33fb6

View File

@@ -582,7 +582,7 @@ let editChanged;
*/ */
function setupEditChange(form) { function setupEditChange(form) {
for (const el of qsa('input, select, textarea', form)) { for (const el of qsa('input, select, textarea', form)) {
el.addEventListener('change', () => { addEvent(el, 'change', () => {
editChanged = true; editChanged = true;
}); });
} }
@@ -591,10 +591,8 @@ function setupEditChange(form) {
} }
} }
onbeforeunload = () => { // all modern browsers ignore string returned from here
// all modern browsers ignore string returned from here onbeforeunload = () => editChanged;
return editChanged;
};