class NfgUi::Components::Elements::DropdownItem
Ino coming soon.
Public Instance Methods
href()
click to toggle source
Automatically supply an :href to the dropdown item when a modal is present so that the dropdown item presents correctly and appears clickable
Calls superclass method
NfgUi::Bootstrap::Components::Base#href
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 49 def href super || (modal ? '#' : nil) end
render() { |: body), class: 'text-center'| ... }
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::DropdownItem#render
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 25 def render if tooltip && disabled content_tag(:span, disabled_component_tooltip_wrapper_html_options) do content_tag(as, html_options.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
Private Instance Methods
base_element()
click to toggle source
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 55 def base_element as end
component_css_class()
click to toggle source
Other classes inherit DropdownItem
(ex: SlatAction
)
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 72 def component_css_class 'dropdown-item' end
default_theme()
click to toggle source
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 59 def default_theme nil end
outlineable?()
click to toggle source
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 67 def outlineable? false end
theme_css_class_prefix()
click to toggle source
# File lib/nfg_ui/components/elements/dropdown_item.rb, line 63 def theme_css_class_prefix 'text-' end