Use TomSelect and dependent-select controller in admin order customer details form and remove ancient jQuery which uses global functions and inline scripts

🎉
This commit is contained in:
Matt-Yorkley
2022-01-30 14:14:47 +00:00
parent be9156d40f
commit 7753d9e1ea
3 changed files with 13 additions and 26 deletions

View File

@@ -1,17 +0,0 @@
var update_state = function(region) {
var country = $('span#' + region + 'country .select2').select2('val');
var state_select = $('span#' + region + 'state select.select2');
$.get(Spree.routes.states_search + "?country_id=" + country, function(states) {
state_select.html('');
var states_with_blank = [{name: '', id: ''}].concat(states);
$.each(states_with_blank, function(pos,state) {
var opt = $(document.createElement('option'))
.attr('value', state.id)
.html(state.name);
state_select.append(opt);
});
state_select.prop("disabled", false).show();
state_select.select2();
})
};