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

Inherits:
Component
  • Object
show all
Defined in:
app/concepts/matestack/ui/bootstrap/components/close.rb

Instance Method Summary collapse

Instance Method Details

#close_attributesObject



14
15
16
17
18
19
20
21
# File 'app/concepts/matestack/ui/bootstrap/components/close.rb', line 14

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

#close_classesObject



23
24
25
26
27
28
# File 'app/concepts/matestack/ui/bootstrap/components/close.rb', line 23

def close_classes
  [].tap do |classes|
    classes << 'btn-close'
    classes << bs_class
  end.join(' ').strip
end

#responseObject



6
7
8
9
10
11
12
# File 'app/concepts/matestack/ui/bootstrap/components/close.rb', line 6

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