Constructor
new Multislider(container, oopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container |
object | DOM container for the widget. | |||||||||||||||||||||||||||||||
o |
object |
<optional> |
Options.
Properties
|
- Implements:
- Widget
- Source:
Methods
(private) _addSvgSlider()
Adds an svg element representing a slider.
- Source:
(private) _calcSliderHeight(idx) → {number}
Calculate the slider height.
Parameters:
| Name | Type | Description |
|---|---|---|
idx |
number | Index of the slider. |
- Source:
Returns:
- Height of the slider in px.
- Type
- number
(private) _calcSliderPos(idx) → {object}
Calculate the position for a given slider.
Parameters:
| Name | Type | Description |
|---|---|---|
idx |
number | Index of the slider (left to right). |
- Source:
Returns:
- Object representing the {x, y} position.
- Type
- object
(private) _calcSliderWidth() → {number}
Calculate the width of each slider.
Each slider's width is width of multislider / number of sliders.
- Source:
Returns:
- Width of each slider in px.
- Type
- number
(protected) _initHandlers()
Initialize mouse and touch event handlers
- Source:
(protected) _initOptions()
Initialize the options
- Source:
(protected) _initState()
Initialize state
- Source:
(protected) _initStateConstraints()
Initialize state constraints
- Source:
(protected) _initSvgEls()
Initialize the svg elements
- Source:
(private) _removeSvgSlider()
Remove an SVG slider element.
- Source:
_setSliderVal(targetSliderPanel, y)
Set value for a slider based on y position of a click event.
Parameters:
| Name | Type | Description |
|---|---|---|
targetSliderPanel |
object | The panel that registered the event. |
y |
number | Y-position of the event. |
- Source:
(protected) _update()
Update (redraw) component based on state.
- Source:
(private) _updateEls()
Updates the SVG elements and state containers.
Adds or removes a number of SVG elements and state containers to match the current number of sliders.
- Source:
(abstract) getVal() → {array}
Get public representation of the state.
- Source:
Returns:
- An array of slider values.
- Type
- array
(abstract) setInternalVal(newSliderVals)
Set the current state in a format specific to each widget.
Same as setVal(), but will not cause an observer callback trigger.
Parameters:
| Name | Type | Description |
|---|---|---|
newSliderVals |
array | An array representing the new slider values |
- Source:
(abstract) setVal(newSliderVals)
Set the current state in a format specific to each widget.
Same as setInternalVal(), but will cause an observer callback trigger.
Parameters:
| Name | Type | Description |
|---|---|---|
newSliderVals |
array | An array representing the new slider values |
- Source: