Show:

The base class for Button Switch.

Constructor

A.ButtonSwitch

(
  • config
)

Parameters:

  • config Object

    Object literal specifying widget configuration properties.

Methods

_afterActivatedChange

() protected

Fires after activated attribute changes.

_afterInnerLabelLeftChange

() protected

Fires after innerLabelLeft attribute changes.

_afterInnerLabelRightChange

() protected

Fires after innerLabelRight attribute changes.

_getInnerCircle

() Node protected

Returns the switch button instance.

Returns:

Node:

_onButtonSwitchClick

() protected

Fires when Button Switch is clicked.

_onButtonSwitchInteraction

() protected

Fires after user interacts.

_onButtonSwitchKey

() protected

Fires when a pres space or enter key.

_setInnerCirclePosition

(
  • activated
)
protected

Updates Inner Circle position with CSS classes.

Parameters:

  • activated Boolean

_uiSetActivate

() protected

Updates the ui according to the value of the activated attribute.

_uiSetInnerLabelLeft

(
  • label
)
protected

Updates the ui according to the value of the innerLabelLeft attribute.

Parameters:

  • label String

_uiSetInnerLabelRight

(
  • label
)
protected

Updates the ui according to the value of the innerLabelRight attribute.

Parameters:

  • label String

bindUI

() protected

Bind the events on the ButtonSwitch UI. Lifecycle.

renderUI

() protected

Renders the ButtonSwitch component instance. Lifecycle.

Properties

ATTRS

Object static

Static property used to define the default attribute configuration for the ButtonSwitch.

Attributes

activated

Boolean

Determines if ButtonSwitch is active or not.

content

Node

Node containing the contents of this field.

innerLabelLeft

String

The label to be used on button left side.

innerLabelRight

String

The label to be used on button right side.