From: Anton Khorev Date: Fri, 14 Jun 2024 16:42:45 +0000 (+0300) Subject: Use .is-invalid to highlight routing inputs with failed geocode lookups X-Git-Tag: live~520^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6c3c4f2751029737d1e447a1a40f32f85217d6ac?hp=280917c7569c226578f7787f4a8baed1de114e45 Use .is-invalid to highlight routing inputs with failed geocode lookups --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index f6b0581ca..efb667420 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -70,7 +70,7 @@ OSM.Directions = function (map) { }); input.on("keydown", function () { - input.removeClass("error"); + input.removeClass("is-invalid"); }); input.on("change", function (e) { @@ -84,7 +84,7 @@ OSM.Directions = function (map) { endpoint.setValue = function (value, latlng) { endpoint.value = value; delete endpoint.latlng; - input.removeClass("error"); + input.removeClass("is-invalid"); input.val(value); if (latlng) { @@ -109,7 +109,7 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { - input.addClass("error"); + input.addClass("is-invalid"); alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value })); return; }