Class: NfgUi::Components::Elements::DropdownItem
- Inherits:
-
Bootstrap::Components::DropdownItem
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::DropdownItem
- NfgUi::Components::Elements::DropdownItem
- Includes:
- Bootstrap::Utilities::Modalable, Bootstrap::Utilities::Themeable, Traits::Active, Traits::Disable, Traits::DisableWith, Traits::Remote, Traits::Theme, Utilities::Confirmable, Utilities::Describable, Utilities::DisableWithable, Utilities::Iconable, Utilities::Methodable, Utilities::Renderable, Utilities::Traitable
- Defined in:
- lib/nfg_ui/components/elements/dropdown_item.rb
Overview
Ino coming soon.
Direct Known Subclasses
Constant Summary
Constants included from Traits::Theme
Traits::Theme::COLOR_TRAITS, Traits::Theme::TRAITS
Constants included from Traits::Disable
Constants included from Traits::DisableWith
Constants included from Traits::Active
Constants included from Traits::Remote
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes included from Bootstrap::Utilities::Disableable
Attributes included from Bootstrap::Utilities::Wrappable
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
-
#href ⇒ Object
Automatically supply an :href to the dropdown item when a modal is present so that the dropdown item presents correctly and appears clickable.
- #render ⇒ Object
Methods included from Traits::Theme
#danger_trait, #dark_trait, #info_trait, #light_trait, #outlined_trait, #primary_trait, #secondary_trait, #success_trait, #warning_trait, #white_trait
Methods included from Traits::Disable
Methods included from Traits::DisableWith
Methods included from Traits::Active
Methods included from Traits::Remote
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Methodable
Methods included from Utilities::Iconable
Methods included from Utilities::DisableWithable
Methods included from Utilities::Describable
Methods included from Utilities::Confirmable
Methods included from Bootstrap::Utilities::Modalable
Methods included from Bootstrap::Utilities::Themeable
Methods inherited from Bootstrap::Components::DropdownItem
Methods included from Bootstrap::Utilities::Remotable
Methods included from Bootstrap::Utilities::Tooltipable
#data, #disabled_component_tooltip_wrapper_html_options, #html_options, #tooltip
Methods included from Bootstrap::Utilities::Disableable
Methods included from Bootstrap::Utilities::Activatable
Methods included from Bootstrap::Utilities::Wrappable
Methods inherited from Bootstrap::Components::Base
#component_family, #data, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#href ⇒ Object
Automatically supply an :href to the dropdown item when a modal is present so that the dropdown item presents correctly and appears clickable
49 50 51 |
# File 'lib/nfg_ui/components/elements/dropdown_item.rb', line 49 def href super || (modal ? '#' : nil) end |
#render ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/nfg_ui/components/elements/dropdown_item.rb', line 25 def render if tooltip && disabled content_tag(:span, ) do content_tag(as, .except(:href)) do if icon NfgUi::Components::Foundations::Icon.new({ traits: ["#{icon} fw"], text: (block_given? ? yield : body), class: 'text-center' }, view_context).render else (block_given? ? yield : body) end end end else super do if icon NfgUi::Components::Foundations::Icon.new({ traits: ["#{icon} fw"], text: (block_given? ? yield : body), class: 'text-center' }, view_context).render else (block_given? ? yield : body) end end end end |