Constructor
new ToggleView()
- Since:
- Source:
Extends
Members
className
- Source:
Methods
Initialize option tooltips using the Formantic UI popup module.
- Source:
disable()
Disable the toggle
- Source:
enable()
Enable the toggle
- Source:
events()
- Source:
getOptionByKey(valueKey) → {ToggleOption|undefined}
Get an option by its DOM key.
Parameters:
| Name |
Type |
Description |
valueKey |
string
|
String key from DOM data attribute. |
- Source:
Returns:
The matching option, or undefined if not found.
-
Type
-
ToggleOption
|
undefined
initialize(options)
Parameters:
| Name |
Type |
Description |
options |
object
|
Configuration options
Properties
| Name |
Type |
Attributes |
Description |
options |
Array.<ToggleOption>
|
|
Array of exactly two options |
selected |
*
|
<optional>
|
The value of the initially selected option |
showDescription |
boolean
|
<optional>
|
Whether to show
description below toggle. True by default. |
tooltipSettings |
object
|
boolean
|
<optional>
|
Custom settings for
Formantic UI popup tooltips. Set to false to disable tooltips entirely. |
|
- Source:
onToggle(e)
Handles toggle option click
Parameters:
| Name |
Type |
Description |
e |
MouseEvent
|
Click event |
- Source:
remove()
- Source:
Remove Formantic UI popup instances from this toggle's options.
- Source:
Render the toggle UI
- Source:
Returns:
This view instance
-
Type
-
ToggleView
toggleDisabled(disabled)
Enable or disable the toggle
Parameters:
| Name |
Type |
Description |
disabled |
boolean
|
Whether the toggle should be disabled |
- Source:
Updates the toggle buttons' active state and icons
Parameters:
| Name |
Type |
Description |
selectedValue |
*
|
The value of the currently selected option |
- Source: