From 229c78b2e3bebec27248012074e4f43af0e6e482 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 18 Oct 2024 09:05:49 +0200 Subject: JavaScript form validation compatibility older browsers (#6777) Restore compatibility with older browsers (e.g. Firefox and Chrome older than 2020) and simplify code at the same time https://developer.mozilla.org/en-US/docs/Web/API/SubmitEvent/submitter Contributes to https://github.com/FreshRSS/FreshRSS/issues/6776 Was introduced by https://github.com/FreshRSS/FreshRSS/pull/4370 (to be retested a bit more, though) --- p/scripts/extra.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/scripts/extra.js') diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 916f1618b..edc9edd95 100644 --- a/p/scripts/extra.js +++ b/p/scripts/extra.js @@ -277,7 +277,7 @@ function init_2stateButton() { function init_configuration_alert() { window.onsubmit = function (e) { - window.hasSubmit = data_leave_validation(document.body, e.submitter ? e.submitter.form : null); + window.hasSubmit = data_leave_validation(document.body, e.target); }; window.onbeforeunload = function (e) { if (window.hasSubmit) { -- cgit v1.2.3