Sha256: d6e060eacd7a4bb7420a3919f406527554c305f2ab174b916cda78d1acea4cf4

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

$(document).on 'change', "input[name$='[shipping_address][shipping_address_same_as_billing]']", (event) ->
  $obj = $(event.currentTarget)

  shipping_fields = $obj.closest('form').find("
    div[class*='_shipping_address_full_name'],
    div[class*='_shipping_address_address1'],
    div[class*='_shipping_address_address2'],
    div[class*='_shipping_address_city'],
    div[class*='_shipping_address_country_code'],
    div[class*='_shipping_address_state_code'],
    div[class*='_shipping_address_postal_code'],
    div[class*='shipping_address_form_group']
  ")

  if $obj.is(':checked')
    shipping_fields.hide().find('input,select').prop('disabled', true).prop('required', true)
  else
    shipping_fields.show().find('input,select').removeAttr('disabled').removeAttr('required')


Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_addresses-1.8.3 app/assets/javascripts/effective_addresses/shipping_address_same_as_billing.js.coffee
effective_addresses-1.8.2 app/assets/javascripts/effective_addresses/shipping_address_same_as_billing.js.coffee
effective_addresses-1.8.1 app/assets/javascripts/effective_addresses/shipping_address_same_as_billing.js.coffee
effective_addresses-1.8.0 app/assets/javascripts/effective_addresses/shipping_address_same_as_billing.js.coffee