aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorMarc Florisson2012-08-21 11:57:46 +0200
committerMarc Florisson2012-08-21 11:57:46 +0200
commit13cdfc734313ea6288fa88a0f27960bfbc966e78 (patch)
tree250c428c6542e176c421b75ff06d8b69bbb11987 /app/assets/javascripts
parent2d756b1c5880986928ae1bc5912ee9038cf9c38f (diff)
downloadchouette-core-13cdfc734313ea6288fa88a0f27960bfbc966e78.tar.bz2
hover on stop points. Refs #108
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/public/journey_pattern.js.coffee19
1 files changed, 19 insertions, 0 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)
+