views/mdc/components/icon.erb in voom-presenters-0.2.0 vs views/mdc/components/icon.erb in voom-presenters-2.0.0
- old
+ new
@@ -14,19 +14,21 @@
icon = ''
else
icon_class_name = "material-icons"
icon = icon_name
end
+ size_class = "v-icon-size-#{comp.size}" unless locals.include? :size_class
%>
<i id="<%= comp.id %>"
- class="<%= class_name %> <%= icon_class_name %>
+ class="<%= class_name %> <%= icon_class_name %> <%= size_class %>
+ <%= 'v-hidden' if comp.respond_to?(:hidden) && comp.hidden %>
<%= 'v-actionable' if comp.events %>
<%= color_classname(comp) %>"
<%= "data-#{data}" if data %>
- style = "<%= color_style(comp) %>
- <%= "font-size: #{comp.size}" if comp.size %>"
- <%= 'tabindex="1"' if class_name.include?('mdc-text-field__icon') && comp.events %>
- <%= erb :"components/event", :locals => {events: events, parent_id: parent_id} %>>
+ style="<%= color_style(comp) %>"
+ <%= 'tabindex="0"' if comp.events %>
+ <%= erb :"components/event", :locals => {comp: comp, events: events, parent_id: parent_id} %>>
<%= icon %>
</i>
<%= erb :"components/tooltip", :locals => {comp: comp.tooltip, parent_id: comp.id} %>
+ <%= expand_text(comp.text) if comp.respond_to?(:text) %>
<% end %>