Commit eb7a8d2
committed
Fix sets manager import form selection multiple default option selected issue.
Currently when the sets manager page loads the "Import how many sets?"
select has "a single set" initially selected and the "Import from
where?" select has "Select filenames below" selected. But then if you
change the first select to "multiple sets" the "Import from where?"
select still has "Select filenames below" selected. Furthermore, if you
then click on that select and use shift-down arrow to select multiple
sets, that first disabled option stays selected. Then form validation
fails for that option since it has no value if you click the "Import"
button.
This just makes it so that when you switch from the "Import how many
sets?" select from "a single set" to "multiple sets", that first option
in the "Import from where?" select is immediately unselected.
There is also a little clean up of this section of JavaScript code. The
elements with id `import_source_select` and name `action.import.number`
are actually the same element, so no need to find them in the DOM twice.
Also ensure the elements exist and are found before trying to work with
them. More of this is needed in this file, but this is probably good
enough for now.1 parent 07f5b04 commit eb7a8d2
1 file changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
0 commit comments