Sha256: 52966ad40be27143d046936c2da8e9b688eb539d47baf7ee17864db179df6414

Contents?: true

Size: 1.15 KB

Versions: 76

Compression:

Stored size: 1.15 KB

Contents

$(function () {
  var countryBased = $('#country_based')
  var stateBased = $('#state_based')
  countryBased.click(show_country)
  stateBased.click(show_state)
  if (countryBased.is(':checked')) {
    show_country()
  } else if (stateBased.is(':checked')) {
    show_state()
  } else {
    show_state()
    stateBased.click()
  }
})
// eslint-disable-next-line camelcase
function show_country () {
  $('#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()
}
// eslint-disable-next-line camelcase
function show_state () {
  $('#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()
}

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
spree_backend-4.0.9 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.1.15 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.7 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.3 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.6 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.2 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.0 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.0.rc3 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.0.rc2 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.3.0.rc1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.5 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.1.14 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.0.8 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.4 app/assets/javascripts/spree/backend/zone.js
spree_backend-3.7.14.1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.3.1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.1.13.1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.0.7.1 app/assets/javascripts/spree/backend/zone.js
spree_backend-4.2.3 app/assets/javascripts/spree/backend/zone.js