X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/87dfbda93261b50332381d0c0c685a71a3b897ad..50f85248db5a2bf1ca860d864f20772f1b87c3d1:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 7fda7f7f0..8a80328cc 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.removeClass("highlight_error"); + input.removeClass("error"); }); input.on("change", function (e) { @@ -68,6 +69,7 @@ OSM.Directions = function (map) { endpoint.setValue = function(value, latlng) { endpoint.value = value; delete endpoint.latlng; + input.removeClass("error"); input.val(value); if (latlng) { @@ -90,8 +92,8 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { + input.addClass("error"); alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value})); - input.addClass("highlight_error"); return; }