china_citys 0.0.4 → 0.0.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: b3e94da4f9bd933b37607b4b70c971616ba34580
4
- data.tar.gz: 00cc7958e7f425b781a6ca159c61237e3df54899
3
+ metadata.gz: 837e251d7e5cb333bf9092adb83a4d39cd9b4b9f
4
+ data.tar.gz: 958f1122f30d57cb22758e73bbd5df9f1323d077
5
5
  SHA512:
6
- metadata.gz: d336e7ce9ae69b5dcdc488ddf5f8d6f14db44dad3267556c2adc22c9e7f2fd692342c584a5ba1f15b043fcf1f463829451de5ade1cea9462072888eef17b50a5
7
- data.tar.gz: 30d08866ee198f96f40ac39d3d431bb95e63696e44257fa3b32b3967c44eea27412da4d48e055110a92056c68f3831ec12c90557a1decf22b9e1f9f43e776263
6
+ metadata.gz: ba980ed38d7b7b9106fe711709f6894f653e02775361ccf7abd6861ea0dd182b3d0389a7c75452ca51c42908a586d04391dc2b1faeef502add5f83d6d623d33a
7
+ data.tar.gz: 64758aeaf655a28a09572c47d50f3c3be0b88842ae2915c4952d684f7b3b2bf801edcbd47a52cc9e35d5cdcac15ce563839eb365f500ab5cad9e82cf742f029c
@@ -1,5 +1,5 @@
1
1
  (($) ->
2
- $.fn.china_citys = () ->
2
+ $.fn.china_city = () ->
3
3
  @each ->
4
4
  selects = $(@).find('.city-select')
5
5
  selects.change ->
@@ -7,11 +7,11 @@
7
7
  next_selects = selects.slice(selects.index(@) + 1) # empty all children city
8
8
  $("option:gt(0)", next_selects).remove()
9
9
  if next_selects.first()[0] and $this.val() # init next child
10
- $.get "/china_citys/#{$(@).val()}", (data) ->
11
- next_selects.first()[0].options.add(new Option(option[0], option[1])) for option in data
10
+ $.get "/china_city/#{$(@).val()}", (data) ->
11
+ next_selects.first()[0].options.add(new Option(option[0], option[1])) for option in data.data
12
12
  # init value after data completed.
13
- next_selects.trigger('china_citys:load_data_completed');
14
-
13
+ next_selects.trigger('china_city:load_data_completed');
14
+ $this.blur()
15
15
  $(document).on 'ready page:load', ->
16
- $('.city-group').china_citys()
16
+ $('.city-group').china_city()
17
17
  )(jQuery)
@@ -1,3 +1,3 @@
1
1
  module ChinaCitys
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: china_citys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - greatbody