effective_addresses 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5688457f9a6889758119802194fa1be36cc5452
|
4
|
+
data.tar.gz: 85af035d0d760ee4e4e997bc8db4611d500d9464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c357eead61b53be0d8a0cb5a40d560a9ba76c707fec9d5ca0bd0d2dc6964b2317d8cb47fe33870617f11e1507ca0a647b81bdbccc7b18a40c1ac6eca8a6feaf4
|
7
|
+
data.tar.gz: 20bc9eed1de75eb80069270b242810f43c71097388119a8082358ebdab1b926f2fe6dc08feb2324cc72bcf513b5cc630b092165c3ccd255f469805746b914f41
|
@@ -1,15 +1,15 @@
|
|
1
1
|
$(document).on 'change', "select[data-effective-address-country]", (event) ->
|
2
2
|
country_code = $(this).val()
|
3
3
|
uuid = $(this).data('effective-address-country')
|
4
|
+
nested_fields = $(this).closest('.nested-fields')
|
4
5
|
form = $(this).closest('form')
|
5
6
|
|
6
|
-
# clear postal_code
|
7
|
-
form.find("input[data-effective-address-postal-code='#{uuid}']").val('')
|
8
|
-
form.find("input[data-effective-address-city='#{uuid}']").val('')
|
7
|
+
# clear postal_code values on country change
|
8
|
+
(nested_fields || form).find("input[data-effective-address-postal-code='#{uuid}']").val('')
|
9
9
|
|
10
10
|
# load state options
|
11
11
|
url = "/addresses/subregions/#{country_code}"
|
12
|
-
state_select = form.find("select[data-effective-address-state='#{uuid}']").first()
|
12
|
+
state_select = (nested_fields || form).find("select[data-effective-address-state='#{uuid}']").first()
|
13
13
|
|
14
14
|
if country_code.length == 0
|
15
15
|
state_select.prop('disabled', true).addClass('disabled').parent('.form-group').addClass('disabled')
|
@@ -26,7 +26,7 @@ module EffectiveAddressesHelper
|
|
26
26
|
def effective_address_pre_select(address)
|
27
27
|
if EffectiveAddresses.pre_selected_country.present?
|
28
28
|
address.country = EffectiveAddresses.pre_selected_country
|
29
|
-
address.state = EffectiveAddresses.pre_selected_state if
|
29
|
+
address.state = EffectiveAddresses.pre_selected_state if EffectiveAddresses.pre_selected_state.present?
|
30
30
|
elsif @@use_geocoder && request.location.present?
|
31
31
|
location = request.location
|
32
32
|
address.country = location.country_code
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_addresses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|