Sha256: 78e0fe436ccab75a02af5c5c22d9faa3e1b1e8d54e8b69aeda9507e4ab3f5447

Contents?: true

Size: 947 Bytes

Versions: 193

Compression:

Stored size: 947 Bytes

Contents

$ ->
  ($ '#country_based').click ->
    show_country()

  ($ '#state_based').click ->
    show_state()

  if ($ '#country_based').is(':checked')
    show_country()
  else if ($ '#state_based').is(':checked')
    show_state()
  else
    show_state()
    ($ '#state_based').click()


show_country = ->
  ($ '#state_members :input').each ->
    ($ this).prop 'disabled', true

  ($ '#state_members').hide()
  ($ '#zone_members :input').each ->
    ($ this).prop 'disabled', true

  ($ '#zone_members').hide()
  ($ '#country_members :input').each ->
    ($ this).prop 'disabled', false

  ($ '#country_members').show()

show_state = ->
  ($ '#country_members :input').each ->
    ($ this).prop 'disabled', true

  ($ '#country_members').hide()
  ($ '#zone_members :input').each ->
    ($ this).prop 'disabled', true

  ($ '#zone_members').hide()
  ($ '#state_members :input').each ->
    ($ this).prop 'disabled', false

  ($ '#state_members').show()

Version data entries

193 entries across 193 versions & 2 rubygems

Version Path
spree_backend-2.2.0 app/assets/javascripts/spree/backend/zone.js.coffee
spree_backend-2.1.5 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.9 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.1.4 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.8 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.1.3 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.7 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.1.2 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.6 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.1.1 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.5 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.1.0 app/assets/javascripts/admin/zone.js.coffee
spree_backend-2.0.4 app/assets/javascripts/admin/zone.js.coffee