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
Methods
close()
Sets the toggle closed
open()
Sets the toggle open
toggle(open)
Parameters:
Name | Type | Description |
---|---|---|
open |
boolean | whether the toggle should be open or not |