Module: PopoverExtension

Included in:
UiBibz::Ui::Core::Component
Defined in:
lib/ui_bibz/ui/extensions/core/component/popover_extension.rb

Instance Method Summary collapse

Instance Method Details

#popover_data_htmlObject

Add popover to a component

By tooltip object

popover = UiBibz::Ui::Core::Notifications::Popover.new("My Popover")
UiBibz::Ui::Core::Component.new("My content", popover: popover)

By Hash

UiBibz::Ui::Core::Component.new("My content", popover: { content: "My Popover" })

By String

UiBibz::Ui::Core::Component.new("My content", popover: "My Popover")


19
20
21
22
23
# File 'lib/ui_bibz/ui/extensions/core/component/popover_extension.rb', line 19

def popover_data_html
  return if options[:popover].nil?

  html_options.update(generate_popover.render)
end

#tooltip_data_htmlObject

Add tooltip to a component

By tooltip object

tooltip = UiBibz::Ui::Core::Notifications::Tooltip.new("My tooltip")
UiBibz::Ui::Core::Component.new("My content", tooltip: tooltip)

By Boolean

UiBibz::Ui::Core::Component.new("My content", tooltip: true)
# or
UiBibz::Ui::Core::Component.new("My content", {tooltip: true}, { title: 'My tooltip' })

By Hash

UiBibz::Ui::Core::Component.new("My content", tooltip: { title: 'My tooltip' })


42
43
44
45
46
# File 'lib/ui_bibz/ui/extensions/core/component/popover_extension.rb', line 42

def tooltip_data_html
  return if options[:tooltip].nil?

  html_options.update(generate_tooltip.render)
end