X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/65ceb77eabe239a8d755c0e55ef52255510dbdb3..7dbf8d83369cb73929080c4ba23fdd7dcd0184df:/app/assets/javascripts/index/directions.js diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 392183cc6..2b3319f8f 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -54,6 +54,10 @@ OSM.Directions = function (map) { } }); + input.on("keydown", function() { + input.removeClass("error"); + }); + input.on("change", function (e) { awaitingGeocode = true; @@ -87,7 +91,8 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { - alert(I18n.t('javascripts.directions.errors.no_place')); + input.addClass("error"); + alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value})); return; }