app/components/coco/base/button/button.rb in coveragebook_components-0.7.2 vs app/components/coco/base/button/button.rb in coveragebook_components-0.7.3
- old
+ new
@@ -72,15 +72,14 @@
unless button_attrs[:type] || link?
button_attrs[:type] = "button"
end
end
- attr_reader :on_click, :resize, :props, :button_attrs
+ attr_reader :on_click, :resize, :button_attrs
- def initialize(click: nil, resize: nil, props: nil, states: nil, loading: false, active: false, button_element: {}, **kwargs)
+ def initialize(click: nil, resize: nil, states: nil, loading: false, active: false, button_element: {}, **kwargs)
@on_click = click
- @props = props.to_h
@resize = resize.to_h
@states = states.to_h
@loading = loading
@active = active
@alpine_data = {}
@@ -181,15 +180,10 @@
[name, props[:tooltip]] if props[:tooltip].present?
end.compact.to_h
end
def alpine_data
- if props.present? || state_tooltips.present?
- {
- tooltips: (state_tooltips if state_tooltips.present?),
- props: (props if props.present?)
- }.compact
- end
+ {tooltips: state_tooltips} if state_tooltips.present?
end
private
def default_states