]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/browse_helper.rb
Using javascript and data attribute instead of inline css
[rails.git] / app / helpers / browse_helper.rb
index 2f07fd2ebe3278e45b05b1759458ea34551e4dc5..c3e013650e7dac0b2a22c16f97858d9a95ddbace 100644 (file)
@@ -77,7 +77,7 @@ module BrowseHelper
     elsif url = telephone_link(key, value)
       link_to h(value), url, :title => t("browse.tag_details.telephone_link", :phone_number => value)
     elsif colour_value = colour_preview(key, value)
-      content_tag(:span, "", :class => "colour-preview-box", :style => "background-color:#{colour_value}", :title => t("browse.tag_details.colour_preview", :colour_value => colour_value)) + colour_value
+      content_tag(:span, "", :class => "colour-preview-box", :"data-colour" => colour_value, :title => t("browse.tag_details.colour_preview", :colour_value => colour_value)) + colour_value
     else
       linkify h(value)
     end