Sha256: 43be5594a061cc98282e51177b29e41b77a8bb7543e1f9068aeee5273ce6cd0c

Contents?: true

Size: 802 Bytes

Versions: 38

Compression:

Stored size: 802 Bytes

Contents

var update_state = function(region) {
  var country        = $('span#' + region + 'country :only-child').val();
  var states         = state_mapper[country];

  var state_select = $('span#' + region + 'state select');
  var state_input = $('span#' + region + 'state input');

  if(states) {
    state_select.html('');
    var states_with_blank = [["",""]].concat(states);
    $.each(states_with_blank, function(pos,id_nm) {
      var opt = $(document.createElement('option'))
                .attr('value', id_nm[0])
                .html(id_nm[1]);
      state_select.append(opt);
    });
    state_select.prop("disabled", false).show();
    state_input.hide().prop("disabled", true);

  } else {
    state_input.prop("disabled", false).show();
    state_select.hide().prop("disabled", true);
  }

};

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
spree_core-1.2.5 app/assets/javascripts/admin/address_states.js
spree_core-1.1.6 app/assets/javascripts/admin/address_states.js
spree_core-1.1.5 app/assets/javascripts/admin/address_states.js
spree_core-1.2.4 app/assets/javascripts/admin/address_states.js
spree_core-1.0.7 app/assets/javascripts/admin/address_states.js
spree_core-1.2.3 app/assets/javascripts/admin/address_states.js
spree_core-1.2.2 app/assets/javascripts/admin/address_states.js
spree_core-1.1.4 app/assets/javascripts/admin/address_states.js
spree_core-1.2.0 app/assets/javascripts/admin/address_states.js
spree_core-1.2.0.rc2 app/assets/javascripts/admin/address_states.js
spree_core-1.2.0.rc1 app/assets/javascripts/admin/address_states.js
spree_core-1.1.3 app/assets/javascripts/admin/address_states.js
spree_core-1.0.6 app/assets/javascripts/admin/address_states.js
spree_core-0.70.7 app/assets/javascripts/admin/address_states.js
spree_core-0.70.6 app/assets/javascripts/admin/address_states.js
spree_core-1.1.2 app/assets/javascripts/admin/address_states.js
spree_core-1.1.2.rc1 app/assets/javascripts/admin/address_states.js
spree_core-1.1.1 app/assets/javascripts/admin/address_states.js
spree_core-1.1.0 app/assets/javascripts/admin/address_states.js
spree_core-1.0.4 app/assets/javascripts/admin/address_states.js