Class: Matestack::Ui::Bootstrap::Components::Close

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/matestack/ui/bootstrap/components/close.rb

Instance Method Summary collapse

Instance Method Details

#close_attributesObject



16
17
18
19
20
21
22
# File 'lib/matestack/ui/bootstrap/components/close.rb', line 16

def close_attributes
  options.merge(
    class: close_classes,
    data: { "bs-dismiss": "#{context.dismiss}" },
    type: 'button'
  ).merge((context.attributes || {}).merge({ 'aria-label': 'Close' }))
end

#close_classesObject



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

#responseObject



8
9
10
11
12
13
14
# File 'lib/matestack/ui/bootstrap/components/close.rb', line 8

def response
  button close_attributes do
    span 'aria-hidden': 'true' do
      # plain "&times;".html_safe
    end
  end
end