Преглед изворни кода

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)
Alexandre Alapetite пре 1 година
родитељ
комит
229c78b2e3
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      p/scripts/extra.js

+ 1 - 1
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) {