Class: Slider

Slider()

Slider component.

Members

(static) STATE

`Slider`'s state definition.
Source:

Methods

attachDragEvents_()

Attaches the drag events to handle value updates when dragging the rail handle. protected
Source:

attached()

Source:

(protected) constrainToRail_(regionnon-null)

Constrains the given region to be inside the rail. This is being used instead of `Drag`'s default behavior, because `Drag` would require the whole handle to be inside the rail element, while we just want to make sure that the left side of the handle is inside it.
Parameters:
Name Type Description
region Object
Source:

disposeInternal()

Source:

getDrag() → (non-null) {Drag}

Returns the `Drag` instance being used.
Source:
Returns:
Type
Drag

(protected) handleElementChanged_(datanon-null)

Handles the `elementChanged` event. Updates the drag container to the new element, and also updates the constrain element.
Parameters:
Name Type Description
data Object
Source:

(protected) onRailClick_(eventnon-null)

Handles mouse down actions on the slider rail and updates the slider value accordingly.
Parameters:
Name Type Description
event Event
Source:

syncMax(newVal)

Synchronizes the slider UI with the `max` state key.
Parameters:
Name Type Description
newVal number The new value of the state key.
Source:

syncMin(newVal)

Synchronizes the slider UI with the `min` state key.
Parameters:
Name Type Description
newVal number The new value of the state key.
Source:

(protected) updateValue_(handlePosition, offset, opt_relativeopt)

Updates the slider value based on the UI state of the handle element.
Parameters:
Name Type Attributes Description
handlePosition number Position of the handle in px.
offset number Offset to be added to normalize relative inputs.
opt_relative boolean <optional>
If the given position is relative to the rail or not.
Source:

(protected) updateValueFromDragData_(datanon-null)

Handles Drag events from the rail handle and updates the slider value accordingly.
Parameters:
Name Type Description
data Object
Source: