Sha256: 6e0f3fca304c684abb43cd2e88f20f8f578a4c11fd15e8995e541d0a8e5cd250

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

window.App ||= {}
class App.GemgentoCheckoutAddress extends App.Base

  beforeAction: =>
    toggleAddress()
    addressTypes = ['billing' , 'shipping']
    for addressType in addressTypes
      $countrySelector = $("#quote_#{addressType}_address_attributes_country_id")
      $regionSelector = $("#quote_#{addressType}_address_attributes_region_id")
      $regionWrapper = $regionSelector.parent()
      App.updateRegions( $countrySelector, $regionSelector, $regionWrapper)

    $('#same_as_billing').on 'change', ->
      toggleAddress()

  toggleAddress = ->
    alert "toggle address"
    checkbox = $('#quote_same_as_billing')
    if checkbox.is(':checked') or checkbox.val() == "1"
      checkbox.prop(":checked")
      $('#shipping_address').hide()
    else
      $('#shipping_address').show()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemgento-2.8.0 app/assets/javascripts/gemgento/checkout/address.coffee