X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1bb52e3cb6da18a4777c8314088c5cb5c48a484a..7dbf8d83369cb73929080c4ba23fdd7dcd0184df:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 689a6eba8..2b3319f8f 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -40,7 +40,8 @@ OSM.Directions = function (map) { shadowUrl: OSM.MARKER_SHADOW, shadowSize: [41, 41] }), - draggable: true + draggable: true, + autoPan: true }); endpoint.marker.on('drag dragend', function (e) { @@ -54,7 +55,7 @@ OSM.Directions = function (map) { }); input.on("keydown", function() { - input.css("background-color", "#fff"); + input.removeClass("error"); }); input.on("change", function (e) { @@ -90,8 +91,8 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { - alert(I18n.t('javascripts.directions.errors.no_place_with_name', {place: endpoint.value})); - input.css("background-color", "rgba(255, 0, 0, 0.5)"); + input.addClass("error"); + alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value})); return; }