Skip to content

Commit

Permalink
Merge pull request #1 from hoangzinh/fix_broken_sort_arrow_svg_in_res…
Browse files Browse the repository at this point in the history
…ource_table

Fix broken sort arrow svg in the resource table
  • Loading branch information
hoangzinh authored Nov 6, 2016
2 parents 2d32e7c + 121f43a commit c57134f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/helpers/administrate/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ def display_resource_name(resource_name)
def svg_tag(asset, svg_id, options = {})
svg_attributes = {
"xlink:href".freeze => "#{asset_url(asset)}##{svg_id}",
height: options[:height],
width: options[:width],
}.delete_if { |_key, value| value.nil? }
height: "100%",
width: "100%",
}
xml_attributes = {
"xmlns".freeze => "http://www.w3.org/2000/svg".freeze,
"xmlns:xlink".freeze => "http://www.w3.org/1999/xlink".freeze,
}
height: options[:height],
width: options[:width],
}.delete_if { |_key, value| value.nil? }

content_tag :svg, xml_attributes do
content_tag :use, nil, svg_attributes
Expand Down

0 comments on commit c57134f

Please sign in to comment.