From: Tom Hughes Date: Mon, 16 Mar 2015 20:48:55 +0000 (+0000) Subject: Fix some validation issues X-Git-Tag: live~4170 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/05caad1a5dfbdf892f4b46b0916a4f6b1de4d2e3?hp=d73a4efef0311ae7fe0afe4bd895d74ba4be2c4c Fix some validation issues --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 03f8cb225..a8615d3eb 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -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 = $("").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(); }); diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 9fbca6171..2df8b7e65 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -783,6 +783,10 @@ nav.secondary { #attribution { display: none; + + table { + width: 100% + } } .attribution_license, diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index a9a7aee00..8665ba02f 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -12,11 +12,11 @@
- <%= 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" %> <%= text_field_tag "route_from", params[:from], :placeholder => t('site.search.from') %>
- <%= 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" %> <%= text_field_tag "route_to" , params[:to] , :placeholder => t('site.search.to') %>
diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index e72214cbe..cb2fd0e07 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -68,7 +68,7 @@
- +
<%= t 'site.index.license.license_url' %> <%= t 'site.index.license.project_url' %>