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
- #collapse ⇒ Object
- #collapsed ⇒ Object
-
#collapsible ⇒ Object
Collapsible checks if collapse is manually set true or false and thus, collapsible.
Instance Method Details
#collapse ⇒ Object
21 22 23 |
# File 'lib/nfg_ui/bootstrap/utilities/collapsible.rb', line 21 def collapse .fetch(:collapse, nil) end |
#collapsed ⇒ Object
25 26 27 |
# File 'lib/nfg_ui/bootstrap/utilities/collapsible.rb', line 25 def collapsed .fetch(:collapsed, nil) end |
#collapsible ⇒ Object
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 [:collapsible] || collapse || !collapsed.nil? end |