Module: Renalware::TooltipHelper

Defined in:
app/helpers/renalware/tooltip_helper.rb

Instance Method Summary collapse

Instance Method Details

#tooltip(label:, content:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/renalware/tooltip_helper.rb', line 5

def tooltip(label:, content:)
  tag.span(title: content,
           class: "has-tip",
           "aria-haspopup" => "true",
           data: {
             tooltip: "",
             options: "disable_for_touch:true"
           }) do
    label
  end
end

#tooltip_with_block(label:) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/renalware/tooltip_helper.rb', line 17

def tooltip_with_block(label:)
  tag.span(title: label,
           class: "has-tip",
           "aria-haspopup" => "true",
           data: {
             tooltip: "",
             options: "disable_for_touch: true; hover_delay: 100;"
           }) do
    yield if block_given?
  end
end