diff options
| author | Michel Etienne | 2012-08-21 14:10:53 +0200 |
|---|---|---|
| committer | Michel Etienne | 2012-08-21 14:10:53 +0200 |
| commit | f5505e924fd512f7d89fc35f6e6a515862de0854 (patch) | |
| tree | 250c428c6542e176c421b75ff06d8b69bbb11987 /app/assets/javascripts | |
| parent | 10c30e65777641945af317bd6cd6806bb9b3a933 (diff) | |
| parent | 13cdfc734313ea6288fa88a0f27960bfbc966e78 (diff) | |
| download | chouette-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.coffee | 19 | ||||
| -rw-r--r-- | app/assets/javascripts/route.js.coffee | 19 |
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) |
