Fix JS for statistics repartition select form (#2896)

* Fix JS for statistics repartition select form

Error was: `s.form is null in extra.js:166:7`
At the same time, disable the form and clears the value while waiting
for the next page to load, to better understand what is happening.

* Whitespace
pull/2899/head
Alexandre Alapetite 5 years ago committed by GitHub
parent 82278af7a9
commit f2e0f051aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      p/scripts/extra.js

@ -163,9 +163,13 @@ function init_select_observers() {
const opt = s.options[s.selectedIndex],
url = opt.getAttribute('data-url');
if (url) {
s.form.querySelectorAll('[type=submit]').forEach(function (b) {
b.disabled = true;
});
s.disabled = true;
s.value = '';
if (s.form) {
s.form.querySelectorAll('[type=submit]').forEach(function (b) {
b.disabled = true;
});
}
location.href = url;
}
};

Loading…
Cancel
Save