posts: fix mis-sized upvote icon in advanced tooltips.

Passing a class to svg_icon_tag accidentally overrode the other classes
we tried to set.
This commit is contained in:
evazion
2021-01-23 00:45:13 -06:00
parent e14bc77249
commit b5670898fe
2 changed files with 4 additions and 3 deletions

View File

@@ -4,8 +4,9 @@ module IconHelper
tag.i(class: "icon #{icon_class} #{klass}", **options)
end
def svg_icon_tag(type, path, **options)
tag.svg(class: "icon svg-icon #{type}", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", **options) do
def svg_icon_tag(type, path, class: nil, **options)
klass = binding.local_variable_get(:class)
tag.svg(class: "icon svg-icon #{type} #{klass}", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", **options) do
tag.path(fill: "currentColor", d: path)
end
end

View File

@@ -8,7 +8,7 @@
<span class="post-tooltip-score post-tooltip-info">
<span><%= @post.score %></span>
<%= upvote_icon(class: "fa-xs") %>
<%= upvote_icon %>
</span>
<% if @post.last_commented_at.present? %>