]> git.openstreetmap.org Git - rails.git/commitdiff
Moved inline styling to stylesheet
authorJ Guthrie <jamie.guthrie@gmail.com>
Thu, 29 Mar 2018 21:48:39 +0000 (22:48 +0100)
committerJ Guthrie <jamie.guthrie@gmail.com>
Thu, 29 Mar 2018 21:48:39 +0000 (22:48 +0100)
app/assets/javascripts/index/directions.js
app/assets/stylesheets/common.scss

index 14be8b3583b87fd30ebbdb0f0b1578e487a98d54..7fda7f7f0b118f1e9b6c52e21cb849ca1e4b44f4 100644 (file)
@@ -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;
         }
 
index 4353e5e659d85628ff9a8f175d291ffdd4465652..462cc50a71c5a55e10f47c414e1d13cee93ace93 100644 (file)
@@ -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. */