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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 837e251d7e5cb333bf9092adb83a4d39cd9b4b9f
|
4
|
+
data.tar.gz: 958f1122f30d57cb22758e73bbd5df9f1323d077
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba980ed38d7b7b9106fe711709f6894f653e02775361ccf7abd6861ea0dd182b3d0389a7c75452ca51c42908a586d04391dc2b1faeef502add5f83d6d623d33a
|
7
|
+
data.tar.gz: 64758aeaf655a28a09572c47d50f3c3be0b88842ae2915c4952d684f7b3b2bf801edcbd47a52cc9e35d5cdcac15ce563839eb365f500ab5cad9e82cf742f029c
|
@@ -1,5 +1,5 @@
|
|
1
1
|
(($) ->
|
2
|
-
$.fn.
|
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 "/
|
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('
|
14
|
-
|
13
|
+
next_selects.trigger('china_city:load_data_completed');
|
14
|
+
$this.blur()
|
15
15
|
$(document).on 'ready page:load', ->
|
16
|
-
$('.city-group').
|
16
|
+
$('.city-group').china_city()
|
17
17
|
)(jQuery)
|
data/lib/china_citys/version.rb
CHANGED