diff options
| author | jpl | 2017-04-26 15:28:42 +0200 |
|---|---|---|
| committer | jpl | 2017-04-26 15:28:49 +0200 |
| commit | 782d7288f75333305635828d19e931ab62decefa (patch) | |
| tree | d26d8e4fe748625906226caa7a1b11cb87c4d67e | |
| parent | 489a05ee6469b711140ca6d4ad6ebe296bc2d82f (diff) | |
| download | chouette-core-782d7288f75333305635828d19e931ab62decefa.tar.bz2 | |
Refs #3207: fix js fn routing_constraint_zone, called in all /new page...
| -rw-r--r-- | app/assets/javascripts/routing_constraint_zones.coffee | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/routing_constraint_zones.coffee b/app/assets/javascripts/routing_constraint_zones.coffee index 458189b36..fc032f074 100644 --- a/app/assets/javascripts/routing_constraint_zones.coffee +++ b/app/assets/javascripts/routing_constraint_zones.coffee @@ -4,8 +4,10 @@ fill_stop_points_options = -> referential_id = document.location.pathname.match(/\d+/g)[0] line_id = document.location.pathname.match(/\d+/g)[1] route_id = $('#routing_constraint_zone_route_id').val() + if errors_on_form() - stop_point_ids = eval($('#stop_point_ids').val()) + stop_point_ids = eval($('#stop_point_ids').val()) + $.ajax url: "/referentials/#{referential_id}/lines/#{line_id}/routes/#{route_id}/stop_points" dataType: 'json' @@ -21,7 +23,6 @@ errors_on_form = -> document.location.pathname.endsWith('routing_constraint_zones') && $('#new_routing_constraint_zone').length $(document).on 'turbolinks:load', -> - if document.location.pathname.endsWith('new') || errors_on_form() + if document.location.pathname.endsWith('routing_constraint_zones/new') || errors_on_form() fill_stop_points_options() $('#routing_constraint_zone_route_id').change(fill_stop_points_options) - |
