class NfgUi::Bootstrap::Components::Button
Bootstrap
Button
Component getbootstrap.com/docs/4.1/components/buttons/
Public Instance Methods
block()
click to toggle source
# File lib/nfg_ui/bootstrap/components/button.rb, line 33 def block options.fetch(:block, false) end
href()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::Base#href
# File lib/nfg_ui/bootstrap/components/button.rb, line 37 def href return if as != :a collapse || super || '#' end
remove_component_css_classes()
click to toggle source
# File lib/nfg_ui/bootstrap/components/button.rb, line 42 def remove_component_css_classes options.fetch(:remove_component_css_classes, false) end
render() { |: body)| ... }
click to toggle source
# File lib/nfg_ui/bootstrap/components/button.rb, line 19 def render if tooltip && disabled content_tag(:span, disabled_component_tooltip_wrapper_html_options) do content_tag(as, html_options) do (block_given? ? yield : body) end end else content_tag(as, html_options) do (block_given? ? yield : body) end end end
Private Instance Methods
assistive_html_attributes()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Utilities::Wrappable#assistive_html_attributes
# File lib/nfg_ui/bootstrap/components/button.rb, line 48 def assistive_html_attributes active ? super.merge(aria: { pressed: true }) : super end
collapse_data_attributes()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Utilities::CollapseToggleable#collapse_data_attributes
# File lib/nfg_ui/bootstrap/components/button.rb, line 56 def collapse_data_attributes as == :a ? super.except!(:target) : super end
component_css_class()
click to toggle source
# File lib/nfg_ui/bootstrap/components/button.rb, line 60 def component_css_class remove_component_css_classes ? '' : 'btn' end
css_classes()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Utilities::Themeable#css_classes
# File lib/nfg_ui/bootstrap/components/button.rb, line 52 def css_classes block ? super + " #{component_css_class}-block" : super end
default_html_wrapper_element()
click to toggle source
# File lib/nfg_ui/bootstrap/components/button.rb, line 64 def default_html_wrapper_element :a end
non_html_attribute_options()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Utilities::Wrappable#non_html_attribute_options
# File lib/nfg_ui/bootstrap/components/button.rb, line 68 def non_html_attribute_options super.push(:block, :remove_component_css_classes) end