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
|