Class: NfgUi::Bootstrap::Components::ModalHeader

Inherits:
Base
  • Object
show all
Defined in:
lib/nfg_ui/bootstrap/components/modal_header.rb

Overview

Bootstrap Modal Component getbootstrap.com/docs/4.1/components/modal/

Direct Known Subclasses

Components::Elements::ModalHeader

Instance Attribute Summary

Attributes inherited from Base

#body, #options, #view_context

Instance Method Summary collapse

Methods inherited from Base

#data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#component_familyObject



10
11
12
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 10

def component_family
  :modal
end

#renderObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 18

def render
  super do
    capture do
      concat((:h5, title, class: 'modal-title')) if title
      concat(NfgUi::Bootstrap::Components::Button.new({ as: :button, class: 'close', theme: nil, data: { dismiss: 'modal' }, aria: { label: 'Close' } }, view_context).render {
        (:span, "×".html_safe, { aria: { hidden: 'true' } })
      })
    end
  end
end

#titleObject



14
15
16
# File 'lib/nfg_ui/bootstrap/components/modal_header.rb', line 14

def title
  options.fetch(:title, nil)
end