china_citys 0.0.5 → 0.0.6
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: 44a7810f461e4701d559c923594c159e3e4040b8
|
4
|
+
data.tar.gz: 4015603631cabce5c5016712e32ab50a8775b51d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 564f42a8f42d5b13d28bb9f00087ad8f9750a04dc0ac3685ab11bfe37cef38691bb65b610567a5b9587eaeb1c88ec6ab48287a283cd210a45bcd09efdd1d351d
|
7
|
+
data.tar.gz: 5981ef8a934e72dbbc2a671d984e0e88e081ede4a7d2a1f44ca13743f304ffea55532d1669017be3fef84e8214811de9c870e46ca5785776c0bd3677cd823262
|
@@ -1,5 +1,5 @@
|
|
1
1
|
(($) ->
|
2
|
-
$.fn.
|
2
|
+
$.fn.china_citys = () ->
|
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 "/
|
10
|
+
$.get "/china_citys/#{$(@).val()}", (data) ->
|
11
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('
|
13
|
+
next_selects.trigger('china_citys:load_data_completed');
|
14
14
|
$this.blur()
|
15
15
|
$(document).on 'ready page:load', ->
|
16
|
-
$('.city-group').
|
16
|
+
$('.city-group').china_citys()
|
17
17
|
)(jQuery)
|
data/lib/china_citys/version.rb
CHANGED