aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorMichel Etienne2012-08-21 14:10:53 +0200
committerMichel Etienne2012-08-21 14:10:53 +0200
commitf5505e924fd512f7d89fc35f6e6a515862de0854 (patch)
tree250c428c6542e176c421b75ff06d8b69bbb11987 /app/assets/javascripts
parent10c30e65777641945af317bd6cd6806bb9b3a933 (diff)
parent13cdfc734313ea6288fa88a0f27960bfbc966e78 (diff)
downloadchouette-core-f5505e924fd512f7d89fc35f6e6a515862de0854.tar.bz2
Merge branch 'master' of chouette.dryade.priv:/srv/git/chouette2
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/public/journey_pattern.js.coffee19
-rw-r--r--app/assets/javascripts/route.js.coffee19
2 files changed, 37 insertions, 1 deletions
diff --git a/app/assets/javascripts/public/journey_pattern.js.coffee b/app/assets/javascripts/public/journey_pattern.js.coffee
new file mode 100644
index 000000000..6ea0c01de
--- /dev/null
+++ b/app/assets/javascripts/public/journey_pattern.js.coffee
@@ -0,0 +1,19 @@
+jQuery ->
+ select_stop_on_map = (event) ->
+ if (event.type == 'mouseenter')
+ if event.target.id.match(/^stop_point_(\w+)$/)
+ stopAreaId = $("#"+event.target.id+" a").attr('href').match(/\d+$/)[0]
+ placeMark = selectFeature.layer.getFeatureByFid( stopAreaId)
+ selectFeature.unselectAll()
+ selectFeature.select( placeMark)
+ else
+ selectFeature.unselectAll()
+
+ $('.journey_patterns.show div.stop_points .stop_point').live("hover", select_stop_on_map)
+
+ make_ajax_pagination = () ->
+ $.get(this.href, null, null, 'script')
+ false
+
+ $('.stop_points_detail .pagination a').live("click", make_ajax_pagination)
+
diff --git a/app/assets/javascripts/route.js.coffee b/app/assets/javascripts/route.js.coffee
index a3dd304d3..274e87f77 100644
--- a/app/assets/javascripts/route.js.coffee
+++ b/app/assets/javascripts/route.js.coffee
@@ -8,8 +8,25 @@ jQuery ->
switch_stop_points = (event) ->
event.preventDefault()
- $('.routes.show .stop_points.content').toggle('slow')
+ $('.routes.show .stop_points_detail').toggle('slow')
$('a.stop_points .switcher').toggle()
$('.routes.show a.stop_points').click(switch_stop_points)
+ select_stop_on_map = (event) ->
+ if (event.type == 'mouseenter')
+ if event.target.id.match(/^stop_point_(\w+)$/)
+ stopAreaId = $("#"+event.target.id+" a").attr('href').match(/\d+$/)[0]
+ placeMark = selectFeature.layer.getFeatureByFid( stopAreaId)
+ selectFeature.unselectAll()
+ selectFeature.select( placeMark)
+ else
+ selectFeature.unselectAll()
+
+ $('.routes.show div.stop_points .stop_point').live("hover", select_stop_on_map)
+
+ make_ajax_pagination = () ->
+ $.get(this.href, null, null, 'script')
+ false
+
+ $('.routes.show .stop_points_detail .pagination a').live("click", make_ajax_pagination)