Class: Matestack::Ui::Bootstrap::Components::Close
- Inherits:
-
BaseComponent
- Object
- Component
- BaseComponent
- Matestack::Ui::Bootstrap::Components::Close
- Defined in:
- lib/matestack/ui/bootstrap/components/close.rb
Instance Method Summary collapse
Instance Method Details
#close_attributes ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/matestack/ui/bootstrap/components/close.rb', line 16 def close_attributes .merge( class: close_classes, data: { "bs-dismiss": "#{context.dismiss}" }, type: 'button' ).merge((context.attributes || {}).merge({ 'aria-label': 'Close' })) end |
#close_classes ⇒ Object
24 25 26 27 28 29 |
# File 'lib/matestack/ui/bootstrap/components/close.rb', line 24 def close_classes [].tap do |classes| classes << 'btn-close' classes << context.bs_class end.join(' ').strip end |
#response ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/matestack/ui/bootstrap/components/close.rb', line 8 def response close_attributes do span 'aria-hidden': 'true' do # plain "×".html_safe end end end |