Module: Decidim::Admin::IconWithTooltipHelper

Defined in:
decidim-admin/app/helpers/decidim/admin/icon_with_tooltip_helper.rb

Instance Method Summary collapse

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 'decidim-admin/app/helpers/decidim/admin/icon_with_tooltip_helper.rb', line 12

def icon_with_tooltip(icon_name, title, options = {})
  with_tooltip(title, options.merge(class: "top")) do
    (:span, data: { tooltip: true, disable_hover: false, click_open: false },
                       title:) do
      icon(icon_name, aria_label: title, role: "img")
    end
  end
end