diff options
| author | 2020-04-12 16:40:06 +0200 | |
|---|---|---|
| committer | 2020-04-12 16:40:06 +0200 | |
| commit | f2e0f051aa52fcf189840ef4b1f5d7dc1ee087f5 (patch) | |
| tree | 350996f2c2408fdf2c5163b9c95da9062fc8191c /p/scripts/extra.js | |
| parent | 82278af7a9e8d0ebfecd301b2889bcbb2e09fcbf (diff) | |
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
Diffstat (limited to 'p/scripts/extra.js')
| -rw-r--r-- | p/scripts/extra.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/p/scripts/extra.js b/p/scripts/extra.js index 9ce0e74ce..86ee61542 100644 --- a/p/scripts/extra.js +++ b/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; } }; |
