Class: ToggleComponent

ToggleComponent(dataObjectopt, optionsopt)

ToggleComponent shows a triangle and represents an open or closed state. The user can change the toggle state by clicking the toggle.

Constructor

new ToggleComponent(dataObjectopt, optionsopt)

Parameters:
Name Type Attributes Default Description
dataObject DataObject <optional>
null
options Object <optional>
null
Source:
To Do:
  • Allow the use of different emoji or even images
Example
const component = new ToggleComponent()
component.listenTo(ToggleComponent.ToggleEvent, (eventName, toggleComponent, isOpen) => {
	console.log('Toggle is open', isOpen)
})

Members

opened

Source:

Methods

close()

Sets the toggle closed
Source:

open()

Sets the toggle open
Source:

toggle(open)

Parameters:
Name Type Description
open boolean whether the toggle should be open or not
Source: