Module: Builder::MouseEvents
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/helpers/glib/json_ui/builder/mouse_events.rb
Instance Method Summary collapse
Instance Method Details
#tooltip(options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/helpers/glib/json_ui/builder/mouse_events.rb', line 11 def tooltip() if !Rails.env.test? key = "tooltip_#{SecureRandom.uuid}" else key = 'tooltip_test' end onMouseEnter ->(action) do action.popovers_open( key: key, placement: [:placement] || 'top', childViews: ->(view) { view.p styleClass: 'tooltip', text: [:text] } ) end onMouseLeave ->(action) do action.popovers_close key: key end end |