Sha256: 4002dfa5dc6b1d39ec3d85431c5027022c1ea4f1b67257fb28fc9568dedde972

Contents?: true

Size: 844 Bytes

Versions: 13

Compression:

Stored size: 844 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    module IconWithTooltipHelper
      # 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.
      def icon_with_tooltip(icon_name, title, options = {})
        with_tooltip(title, options.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
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.4 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.29.0 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.3 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.29.0.rc4 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.29.0.rc3 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.29.0.rc2 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.29.0.rc1 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.2 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.1 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.0 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.0.rc5 app/helpers/decidim/admin/icon_with_tooltip_helper.rb
decidim-admin-0.28.0.rc4 app/helpers/decidim/admin/icon_with_tooltip_helper.rb