From efd17cfbe9e02467e4275d3793ff8e6d7cec4815 Mon Sep 17 00:00:00 2001 From: J Guthrie Date: Thu, 29 Mar 2018 22:48:39 +0100 Subject: [PATCH] Moved inline styling to stylesheet --- app/assets/javascripts/index/directions.js | 4 ++-- app/assets/stylesheets/common.scss | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 14be8b358..7fda7f7f0 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.css("background-color", "#fff"); + input.removeClass("highlight_error"); }); input.on("change", function (e) { @@ -91,7 +91,7 @@ OSM.Directions = function (map) { endpoint.hasGeocode = true; if (json.length === 0) { alert(I18n.t('javascripts.directions.errors.no_place', {place: endpoint.value})); - input.css("background-color", "rgba(255, 0, 0, 0.5)"); + input.addClass("highlight_error"); return; } diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 4353e5e65..462cc50a7 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -938,6 +938,10 @@ header .search_forms, border-radius: 0 2px 2px 0; } + input.highlight_error { + background-color: rgba(255, 0, 0, 0.5); + } + select { /* this next line is to polyfill the vertical alignment of text within a select element, * which is different between firefox and chrome. */ -- 2.39.5