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:
@@ -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;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user