11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'app/helpers/glib/json_ui/builder/mouse_events.rb', line 11
def tooltip(options)
return unless options
if !Rails.env.test?
key = "tooltip_#{SecureRandom.uuid}"
else
key = 'tooltip_test'
end
onMouseEnter ->(action) do
action.popovers_show(
key: key,
placement: options[:placement] || 'top',
content: ->(popover) do
popover.body childViews: ->(view) {
view.p styleClass: 'tooltip', text: options[:text]
}
end
)
end
onMouseLeave ->(action) do
action.popovers_close key: key
end
end
|