]> git.openstreetmap.org Git - rails.git/commitdiff
Fix some validation issues
authorTom Hughes <tom@compton.nu>
Mon, 16 Mar 2015 20:48:55 +0000 (20:48 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 16 Mar 2015 20:49:14 +0000 (20:49 +0000)
app/assets/javascripts/index/directions.js
app/assets/stylesheets/common.scss
app/views/layouts/_search.html.erb
app/views/layouts/map.html.erb

index 03f8cb2256038b049aee3a8174fb788ce334a51a..a8615d3eb11339f3cc7c35a39a9f06d28f00fdb5 100644 (file)
@@ -303,7 +303,7 @@ OSM.Directions = function (map) {
 
   $(".routing_marker").on('dragstart', function (e) {
     e.originalEvent.dataTransfer.effectAllowed = 'move';
-    e.originalEvent.dataTransfer.setData('id', this.id);
+    e.originalEvent.dataTransfer.setData('type', $(this).data('type'));
     var img = $("<img>").attr("src", $(e.originalEvent.target).attr("src"));
     e.originalEvent.dataTransfer.setDragImage(img.get(0), 12, 21);
   });
@@ -321,11 +321,11 @@ OSM.Directions = function (map) {
     $("#map").on('drop', function (e) {
       e.preventDefault();
       var oe = e.originalEvent;
-      var id = oe.dataTransfer.getData('id');
+      var type = oe.dataTransfer.getData('type');
       var pt = L.DomEvent.getMousePosition(oe, map.getContainer());  // co-ordinates of the mouse pointer at present
       pt.y += 20;
       var ll = map.containerPointToLatLng(pt);
-      endpoints[id === 'marker_from' ? 0 : 1].setLatLng(ll);
+      endpoints[type === 'from' ? 0 : 1].setLatLng(ll);
       getRoute();
     });
 
index 9fbca617195cd92a6e3752c26494025c138e6871..2df8b7e6537e6d09b285f4adfb555749911936cd 100644 (file)
@@ -783,6 +783,10 @@ nav.secondary {
 
 #attribution {
   display: none;
+
+  table {
+    width: 100%
+  }
 }
 
 .attribution_license,
index a9a7aee00f93ab8ee4cfaed1ac042cd5ffd6dacb..8665ba02f1b13a2fdfab970cae733e8afd4fa848 100644 (file)
     <div class="header"><span class="icon close"></span></div>
 
     <div class="line">
-      <%= image_tag "marker-green.png", :class => "routing_marker", :id => "marker_from", :draggable => "true" %>
+      <%= image_tag "marker-green.png", :class => "routing_marker", :data => { :type =>  "from" }, :draggable => "true" %>
       <span class="force_width"><%= text_field_tag "route_from", params[:from], :placeholder => t('site.search.from') %></span>
     </div>
     <div class="line">
-      <%= image_tag "marker-red.png", :class => "routing_marker", :id => "marker_to", :draggable => "true" %>
+      <%= image_tag "marker-red.png", :class => "routing_marker", :data => { :type => "to" }, :draggable => "true" %>
       <span class="force_width"><%= text_field_tag "route_to"  , params[:to]  , :placeholder => t('site.search.to') %></span>
     </div>
     <div class="line">
index e72214cbefe86fae1d9e6c816bd99766fec39c3c..cb2fd0e07a33007e082d437710ee88b75effba5d 100644 (file)
@@ -68,7 +68,7 @@
   </div>
 
   <div id="attribution">
-    <table width="100%">
+    <table>
       <tr>
         <td class="attribution_license"><%= t 'site.index.license.license_url' %></td>
         <td class="attribution_project"><%= t 'site.index.license.project_url' %></td>