Class: Toggler

Toggler(options)

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
Name Type Description
eventBus OO.EventEmitter

Object used to emit section-toggled events.

$container jQuery.Object

to apply toggling to

prefix string

a prefix to use for the id.

page Page

to allow storage of session for future visits

Source:

Methods

isCollapsedByDefault() → {boolean}

Check if sections should be collapsed by default

Source:
Returns:
Type
boolean

reveal(id) → {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

Source:
Returns:

Target ID was found

Type
boolean

toggle($heading, 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

fromSaved boolean

Section is being toggled from a saved state

Source:
Returns:
Type
boolean