PageHeaderExpandable

PageHeaderExpandable

new PageHeaderExpandable(element, options)

Source:
Parameters:
Name Type Description
element HTMLElement

DOM element for component instantiation and scope

options Object
Properties
Name Type Description
toggleSelector String

Element used to toggle the visibility of the panel

headerSelector String

Element always visible

attachClickListener Boolean

Whether or not to bind click events

Classes

PageHeaderExpandable

Methods

destroy()

Description:
  • Destroy component.

Source:

handleClickOnHeader(e)

Description:
  • Clicks the toggle button.

Source:
Parameters:
Name Type Description
e Event

handleClickOnToggle(e)

Description:
  • Toggles the visibility of the main panel.

Source:
Parameters:
Name Type Description
e Event
Fires:

init()

Description:
  • Initialise component.

Source:

on(eventName, callback) → {void}

Description:
  • Register a callback function for a specific event.

Source:
Example
// Registering a callback for the 'toggle' event
pageHeaderExpandable.on('onToggle', (event) => {
  console.log('Toggle event occurred!', event);
});
Parameters:
Name Type Description
eventName string

The name of the event to listen for.

callback function

The callback function to be invoked when the event occurs.

Returns:
Type
void

trigger(eventName, eventData)

Description:
  • Trigger a component event.

Source:
Parameters:
Name Type Description
eventName string

The name of the event to trigger.

eventData any

Data associated with the event.

(static) autoInit(root) → {PageHeaderExpandable}

Source:
Parameters:
Name Type Description
root HTMLElement

DOM element for component instantiation and scope

Returns:

An instance of PageHeaderExpandable.

Type
PageHeaderExpandable

Events

onToggle

Description:
  • An array of supported events for this component.

Source:
Type:
  • Array.<string>