diff options
| author | Vlatka Pavisic | 2017-04-11 15:35:01 +0200 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-04-11 15:35:01 +0200 |
| commit | aa481c087b162bc775b4418e205f91c5b6bead19 (patch) | |
| tree | 914ba9b39e0338317bcc2bfd839f745647beda1a /app/assets/javascripts | |
| parent | 8adf909694b52959483818bf839d6e180015eb99 (diff) | |
| download | chouette-core-aa481c087b162bc775b4418e205f91c5b6bead19.tar.bz2 | |
Refs #3047: Associate RoutingConstraintZone with StopPoints
Diffstat (limited to 'app/assets/javascripts')
| -rw-r--r-- | app/assets/javascripts/routing_constraint_zones.coffee | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/routing_constraint_zones.coffee b/app/assets/javascripts/routing_constraint_zones.coffee new file mode 100644 index 000000000..57f94e654 --- /dev/null +++ b/app/assets/javascripts/routing_constraint_zones.coffee @@ -0,0 +1,18 @@ +fill_stop_points_options = -> + stop_point_select = $('#routing_constraint_zone_stop_point_ids') + stop_point_select.empty() + route_id = $('#routing_constraint_zone_route_id').val() + $.ajax + url: "/referentials/5/lines/162/routes/#{route_id}/stop_points" + dataType: 'json' + success: (data, textStatus, jqXHR) -> + for stop_point in data + stop_point_select.append "<option value='#{stop_point.id}'>#{stop_point.name}</option>" + error: (jqXHR, textStatus, errorThrown) -> + console.log textStatus + console.log errorThrown + +$ -> + if document.location.pathname.endsWith('new') + fill_stop_points_options() + $('#routing_constraint_zone_route_id').change(fill_stop_points_options) |
