Module: NfgUi::Bootstrap::Utilities::Collapsible

Included in:
Components::Collapse, CollapseToggleable, Components::Patterns::Tile, Components::Patterns::TileHeader
Defined in:
lib/nfg_ui/bootstrap/utilities/collapsible.rb

Overview

Allows components to carry collapse attributes to more easily pass collapse status to a collapsible target

Example: Tile & TileHeader both include Collapsible because they both pass collapse attributes to a collapse button within TileHeader

They do not, however need a collapse toggle unlike a NavbarToggle / Button, and thus they do not include The CollapseToggleable module

CollapseToggleable components have this module included by default via the CollapseToggleable module.

Instance Method Summary collapse

Instance Method Details

#collapseObject



21
22
23
# File 'lib/nfg_ui/bootstrap/utilities/collapsible.rb', line 21

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

#collapsedObject



25
26
27
# File 'lib/nfg_ui/bootstrap/utilities/collapsible.rb', line 25

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

#collapsibleObject

Collapsible checks if collapse is manually set true or false and thus, collapsible



30
31
32
# File 'lib/nfg_ui/bootstrap/utilities/collapsible.rb', line 30

def collapsible
  options[:collapsible] || collapse || !collapsed.nil?
end