diff options
| author | Alban Peignier | 2015-05-25 16:56:04 +0200 |
|---|---|---|
| committer | Alban Peignier | 2015-05-25 16:56:04 +0200 |
| commit | 7d5d6075e3f37485d840036b05edf80e25e1e1e4 (patch) | |
| tree | 54a9e106af7e58a77242107113db977a48eda9ea | |
| parent | f69492f08988fe9dc3e89839011e79deb09ed35a (diff) | |
| download | chouette-core-7d5d6075e3f37485d840036b05edf80e25e1e1e4.tar.bz2 | |
Fix javascript callbacks for sortable StopPoints
| -rw-r--r-- | app/views/routes/_form.html.erb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb index 2aa9dd8b7..2a4158b61 100644 --- a/app/views/routes/_form.html.erb +++ b/app/views/routes/_form.html.erb @@ -28,38 +28,12 @@ <script> $(document).ready( function() { - var stop_point_ids = []; - var order_position = function() { $('#stop_points input[type="hidden"][id$="position"]').each(function(index) { $(this).val(index); }); }; - var write_stop_point_ids = function(){ - $('#stop_points input[type="hidden"][class~="stop_point_id"]').each(function(index,element) { - - - // soit le parent a la classe added_stop_point - if ( $(element).hasClass("added_stop_point") ){ - $(this).attr("value", ""); - } else { - $(this).attr("value", stop_point_ids.shift()); - } - }); - } - - var empty_stop_point_ids = function() { - while(stop_point_ids.length > 0) { - stop_point_ids.pop(); - } - $('#stop_points input[type="hidden"][class="stop_point_id"]').map(function() { - stop_point_ids.push( $(this).val()); - }); - // console.log( "before-remove"); - // console.log( stop_point_ids); - }; - $('#stop_points').sortable({ axis: 'y', dropOnEmpty: false, @@ -68,11 +42,7 @@ $(document).ready( function() { items: '.stop_point', opacity: 0.4, scroll: true, - start: function( event, ui ) { - empty_stop_point_ids(); - }, update: function( event, ui ) { - write_stop_point_ids(); order_position(); } }); @@ -104,4 +74,3 @@ $(document).ready( function() { </script> - |
