Class: NfgUi::Bootstrap::Components::Dropdown
- Includes:
- Utilities::DropdownDirectionable
- Defined in:
- lib/nfg_ui/bootstrap/components/dropdown.rb
Overview
Bootstrap Dropdown Component getbootstrap.com/docs/4.1/components/dropdowns/
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Utilities::DropdownDirectionable
#dropleft, #dropright, #dropup
Methods inherited from Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#button ⇒ Object
11 12 13 |
# File 'lib/nfg_ui/bootstrap/components/dropdown.rb', line 11 def .fetch(:button, '') end |
#component_family ⇒ Object
15 16 17 |
# File 'lib/nfg_ui/bootstrap/components/dropdown.rb', line 15 def component_family :dropdown end |
#offset ⇒ Object
19 20 21 |
# File 'lib/nfg_ui/bootstrap/components/dropdown.rb', line 19 def offset .fetch(:offset, '') end |
#render ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nfg_ui/bootstrap/components/dropdown.rb', line 27 def render super do capture do if .present? concat(NfgUi::Bootstrap::Components::DropdownToggle.new({ body: , theme: theme, as: :button, offset: offset }, view_context).render) end concat(block_given? ? yield : body) end end end |
#theme ⇒ Object
23 24 25 |
# File 'lib/nfg_ui/bootstrap/components/dropdown.rb', line 23 def theme .fetch(:theme, NfgUi::DEFAULT_BOOTSTRAP_THEME) end |