Class: NfgUi::Bootstrap::Components::DropdownItem
- Includes:
- Utilities::Activatable, Utilities::Disableable, Utilities::Tooltipable, Utilities::Wrappable
- Defined in:
- lib/nfg_ui/bootstrap/components/dropdown_item.rb
Overview
Bootstrap Dropdown Items Component getbootstrap.com/docs/4.1/components/dropdowns/#menu-items
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Utilities::Disableable
Attributes included from Utilities::Wrappable
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
- #component_family ⇒ Object
-
#initialize ⇒ DropdownItem
constructor
We do not want to overwrite button_to’s interpretation of ‘remote`.
- #render ⇒ Object
Methods included from Utilities::Tooltipable
#data, #disabled_component_tooltip_wrapper_html_options, #html_options, #tooltip
Methods included from Utilities::Disableable
Methods included from Utilities::Activatable
Methods included from Utilities::Wrappable
Methods inherited from Base
#data, #href, #html_options, #id, #style
Constructor Details
#initialize ⇒ DropdownItem
We do not want to overwrite button_to’s interpretation of ‘remote`. Conditionally include Remotable when not using as: :button_to
17 18 19 20 21 22 |
# File 'lib/nfg_ui/bootstrap/components/dropdown_item.rb', line 17 def initialize(*) super if as != :button_to extend Bootstrap::Utilities::Remotable end end |
Instance Method Details
#component_family ⇒ Object
24 25 26 |
# File 'lib/nfg_ui/bootstrap/components/dropdown_item.rb', line 24 def component_family :dropdown end |
#render ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/nfg_ui/bootstrap/components/dropdown_item.rb', line 28 def render if tooltip && disabled content_tag(:span, ) do content_tag(as, .except(:href)) do (block_given? ? yield : body) end end else content_tag(as, ) do (block_given? ? yield : body) end end end |