From: Tom Hughes Date: Mon, 2 Apr 2018 14:24:03 +0000 (+0100) Subject: Tweak highlighting of geolocation errors X-Git-Tag: live~3073 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7e6e1dfbaf2d9112aa0c86a2546fa1780dd69023 Tweak highlighting of geolocation errors --- diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 7fda7f7f0..1057fa58d 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -54,7 +54,7 @@ OSM.Directions = function (map) { }); input.on("keydown", function() { - input.removeClass("highlight_error"); + input.removeClass("error"); }); input.on("change", function (e) { @@ -90,8 +90,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; } diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 462cc50a7..0a5d9164e 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -938,8 +938,8 @@ header .search_forms, border-radius: 0 2px 2px 0; } - input.highlight_error { - background-color: rgba(255, 0, 0, 0.5); + input.error { + background-color: rgba($red, 0.4); } select {