From 5aedb33fb663ee235dd3e666a6f1d7375a53afc2 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 21 Mar 2025 23:19:31 +0100 Subject: [PATCH] JS: Simplify onbeforeunload --- adminer/static/functions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 8cc23cd5..db9b0e66 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -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; -- 2.39.5