Sha256: e76ff7fe4fbbc20a9c8de064d082859edfba669b2fc411def45b6fa72373b10c

Contents?: true

Size: 1.44 KB

Versions: 10

Compression:

Stored size: 1.44 KB

Contents

$(function() {
  if ($('#country_based').is(':checked')) {
    show_country();
  } else if ($('#state_based').is(':checked')) {
    show_state();
  } else {
    show_zone();
  }
  $('#country_based').click(function() { show_country();} );
  $('#state_based').click(function() { show_state();} );
  $('#zone_based').click(function() { show_zone();} );
})

var show_country = function() {
  $('#state_members :input').each(function() { $(this).prop("disabled", true); })
  $('#state_members').hide();
  $('#zone_members :input').each(function() { $(this).prop("disabled", true); })
  $('#zone_members').hide();
  $('#country_members :input').each(function() { $(this).prop("disabled", false); })
  $('#country_members').show();
};

var show_state = function() {
  $('#country_members :input').each(function() { $(this).prop("disabled", true);
 })
  $('#country_members').hide();
  $('#zone_members :input').each(function() { $(this).prop("disabled", true);
 })
  $('#zone_members').hide();
  $('#state_members :input').each(function() { $(this).prop("disabled", false); })
  $('#state_members').show();
};

var show_zone = function() {
  $('#state_members :input').each(function() { $(this).prop("disabled", true);
 })
  $('#state_members').hide();
  $('#country_members :input').each(function() { $(this).prop("disabled", true);
 })
  $('#country_members').hide();
  $('#zone_members :input').each(function() { $(this).prop("disabled", false); })
  $('#zone_members').show();
};

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_core-0.70.7 app/assets/javascripts/admin/zone.js
spree_core-0.70.6 app/assets/javascripts/admin/zone.js
spree_core-0.70.5 app/assets/javascripts/admin/zone.js
spree_core-0.70.4 app/assets/javascripts/admin/zone.js
spree_core-0.70.3 app/assets/javascripts/admin/zone.js
spree_core-0.70.2 app/assets/javascripts/admin/zone.js
spree_core-0.70.1 app/assets/javascripts/admin/zone.js
spree_core-0.70.0 app/assets/javascripts/admin/zone.js
spree_core-0.70.0.rc2 app/assets/javascripts/admin/zone.js
spree_core-0.70.RC1 app/assets/javascripts/admin/zone.js