Module: Decidim::Admin::IconWithTooltipHelper
- Defined in:
- app/helpers/decidim/admin/icon_with_tooltip_helper.rb
Instance Method Summary collapse
-
#icon_with_tooltip(icon_name, title, options = {}) ⇒ Object
This helper adds the necessary boilerplate for the admin icon with tooltip.
Instance Method Details
#icon_with_tooltip(icon_name, title, options = {}) ⇒ Object
This helper adds the necessary boilerplate for the admin icon with tooltip.
icon_name - A String representing the icon name title - A String that will be shown when hovering the icon.
class - Any extra class that will be added to the link.
data - This option can be used to add custom data attributes.
12 13 14 15 16 17 18 19 |
# File 'app/helpers/decidim/admin/icon_with_tooltip_helper.rb', line 12 def icon_with_tooltip(icon_name, title, = {}) with_tooltip(title, .merge(class: "top")) do content_tag(:span, data: { tooltip: true, disable_hover: false, click_open: false }, title:) do icon(icon_name, aria_label: title, role: "img") end end end |