effective_addresses 1.3.4 → 1.3.5
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: 2d0c4361e8830a2fb6bb359f7d34d74f6eb44e56
|
4
|
+
data.tar.gz: 61c3558e17e2bfee0d994b319a23bfd7ab7dc3af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af70e912d4cb310996e0d5d98ef7eb2239153f594da4486a55ebcb25ad353e8f9e13eec59e05877efd27f5c3f6cb94d140bd1d6ca6a26561359dd22896ba892
|
7
|
+
data.tar.gz: e61435314450ee49f758422a038b69ebb9aed78075cefc8d3b5dc4f1acb2429bf9c0490eaa05ac2a5a69a4771ac57680140ac5d05c8ec999efea633d8efb5b54
|
@@ -1,4 +1,4 @@
|
|
1
|
-
loadSubregions = ($countrySelect) ->
|
1
|
+
loadSubregions = ($countrySelect, clearPostalCode = false) ->
|
2
2
|
$.each $countrySelect, (index, countrySelector) ->
|
3
3
|
$particularCountrySelect = $(countrySelector)
|
4
4
|
countryCode = $particularCountrySelect.val()
|
@@ -9,8 +9,8 @@ loadSubregions = ($countrySelect) ->
|
|
9
9
|
|
10
10
|
$container = if $nestedFields.length == 0 then $form else $nestedFields
|
11
11
|
|
12
|
-
# clear postal_code values on country change
|
13
|
-
$container.find("input[data-effective-address-postal-code='#{uuid}']").val('')
|
12
|
+
# clear postal_code values on country change if it is turned on
|
13
|
+
$container.find("input[data-effective-address-postal-code='#{uuid}']").val('') if clearPostalCode
|
14
14
|
|
15
15
|
# load state options
|
16
16
|
url = "/addresses/subregions/#{countryCode}"
|
@@ -20,18 +20,18 @@ loadSubregions = ($countrySelect) ->
|
|
20
20
|
$stateSelect.prop('disabled', true).addClass('disabled').parent('.form-group').addClass('disabled')
|
21
21
|
$stateSelect.html('<option value="">Please choose a country first</option>')
|
22
22
|
else
|
23
|
-
$stateSelect.
|
23
|
+
$stateSelect.prop('disabled', false).removeClass('disabled').parent('.form-group').removeClass('disabled')
|
24
24
|
$stateSelect.find('option').first().text('loading...')
|
25
25
|
$stateSelect.load url, ->
|
26
26
|
stateSelectAvailable = $(@).find('option:last').val().length > 0
|
27
27
|
if stateSelectAvailable
|
28
28
|
$(@).prop('required', true)
|
29
|
-
$(@).
|
29
|
+
$(@).prop('disabled', false)
|
30
30
|
else
|
31
|
-
$(@).
|
31
|
+
$(@).prop('required', false)
|
32
32
|
$(@).prop('disabled', true)
|
33
33
|
|
34
|
-
$(document).on 'change', 'select[data-effective-address-country]', -> loadSubregions($(@))
|
34
|
+
$(document).on 'change', 'select[data-effective-address-country]', -> loadSubregions($(@), true)
|
35
35
|
|
36
36
|
$ -> loadSubregions($('select[data-effective-address-country]'))
|
37
37
|
$(document).on 'page:change', -> loadSubregions($('select[data-effective-address-country]'))
|
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.5
|
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-10-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|