File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
app/code/Magento/Tax/view/adminhtml/templates/rate Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -33,28 +33,25 @@ require([
33
33
window.updater.sortedRegions[country].length);
34
34
35
35
if (!hasRegions && selectEl) {
36
- var hasWildcard = false, i ;
36
+ var i, zeroOptIndex = -1, emptyOptIndex = -1 ;
37
37
38
38
for (i = 0; i < selectEl.options.length; i++) {
39
- if (selectEl.options[i].value === '*') { hasWildcard = true; break; }
39
+ if (selectEl.options[i].value === '0') { zeroOptIndex = i; break; }
40
+ if (emptyOptIndex === -1 && selectEl.options[i].value === '') { emptyOptIndex = i; }
40
41
}
41
- if (!hasWildcard) {
42
- var opt = document.createElement('option');
43
- opt.value = '*';
44
- opt.text = '*';
45
- opt.title = '*';
46
- try {
47
- selectEl.options.add(opt, 1);
48
- } catch (e)
49
- {
50
- selectEl.insertBefore(opt, selectEl.options[1] || null);
51
- }
42
+
43
+ if (zeroOptIndex !== -1) {
44
+ selectEl.selectedIndex = zeroOptIndex;
45
+ } else if (emptyOptIndex !== -1) {
46
+ selectEl.selectedIndex = emptyOptIndex;
47
+ } else if (selectEl.options.length) {
48
+ selectEl.selectedIndex = 0;
52
49
}
53
- selectEl.value = '*';
50
+
54
51
selectEl.disabled = true; // keep disable mode
55
52
}
56
53
if (!hasRegions && textEl) {
57
- textEl.value = '* ';
54
+ textEl.value = '';
58
55
}
59
56
}
60
57
$('#tax_country_id').on('change', function () { setTimeout(enforceWildcard, 0); });
You can’t perform that action at this time.
0 commit comments