1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 22:56:46 +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) {
for (const el of qsa('input, select, textarea', form)) {
el.addEventListener('change', () => {
addEvent(el, 'change', () => {
editChanged = true;
});
}
@@ -591,10 +591,8 @@ function setupEditChange(form) {
}
}
onbeforeunload = () => {
// all modern browsers ignore string returned from here
return editChanged;
};
// all modern browsers ignore string returned from here
onbeforeunload = () => editChanged;