Class: Matestack::Ui::Bootstrap::Components::Button
Instance Method Summary
collapse
Methods included from Registry
#bs_accordion, #bs_alert, #bs_avatar, #bs_badge, #bs_breadcrumb, #bs_btn, #bs_btn_group, #bs_card, #bs_carousel, #bs_close, #bs_col, #bs_collapse, #bs_container, #bs_dropdown, #bs_figure, #bs_form_checkbox, #bs_form_input, #bs_form_radio, #bs_form_select, #bs_form_submit, #bs_form_switch, #bs_icon, #bs_list_group, #bs_modal, #bs_navbar, #bs_page_heading, #bs_pagination, #bs_popover, #bs_progress, #bs_row, #bs_scrollspy, #bs_section_card, #bs_sidebar, #bs_smart_collection, #bs_spinner, #bs_tab_nav, #bs_tab_nav_content, #bs_toast, #bs_tooltip
Instance Method Details
34
35
36
37
38
|
# File 'lib/matestack/ui/bootstrap/components/button.rb', line 34
def button_response(&block)
button button_attributes do
inner_response(&block)
end
end
|
#inner_response(&block) ⇒ Object
40
41
42
43
|
# File 'lib/matestack/ui/bootstrap/components/button.rb', line 40
def inner_response(&block)
plain context.text if context.text
yield if block_given?
end
|
#response(&block) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/matestack/ui/bootstrap/components/button.rb', line 12
def response(&block)
if context.transition.present? && context.transition.is_a?(Hash)
transition button_attributes.merge(context.transition.merge({role: "button"})) do
inner_response(&block)
end
elsif context.action.present? && context.action.is_a?(Hash)
action button_attributes.merge(context.action.merge({role: "button"})) do
inner_response(&block)
end
elsif context.onclick.present? && context.onclick.is_a?(Hash)
onclick button_attributes.merge(context.onclick.merge({role: "button"})) do
inner_response(&block)
end
elsif context.link.present? && context.link.is_a?(Hash)
a button_attributes.merge(context.link.merge({role: "button"})) do
inner_response(&block)
end
else
button_response(&block)
end
end
|