new Toggler(options)
A class for enabling toggling
Toggling can be disabled on a sepcific heading by adding the collapsible-heading-disabled class.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
- Source:
Methods
isCollapsedByDefault() → {boolean}
Check if sections should be collapsed by default
- Source:
Returns:
- Type
- boolean
reveal(id, $container, page) → {boolean}
Reveals an element and its parent section as identified by it's id
Parameters:
Name | Type | Description |
---|---|---|
id |
string | An element ID within the $container |
$container |
Object | jQuery element to search in |
page |
Page |
- Source:
Returns:
Target ID was found
- Type
- boolean
toggle($heading, page, fromSaved) → {boolean}
Given a heading, toggle it and any of its children
Parameters:
Name | Type | Description |
---|---|---|
$heading |
jQuery.Object | A heading belonging to a section |
page |
Page | |
fromSaved |
boolean | Section is being toggled from a saved state |
- Source:
Returns:
- Type
- boolean