Slider
Class used to handle the sliders and their labels.
Constructor Summary
Public Constructor | ||
public |
constructor(opts: object) |
Member Summary
Public Members | ||
public |
Sets a callback for when the slider changes value. |
|
public |
callbackArgs: * Sets the arguments passed to the callback function set in Slider.callback. |
|
public |
clone: dom.Input Creates a Dom element from the cloned Input. |
|
public |
Sets the color in HEX format of the slider. |
|
public |
Sets the amount of decimal places displayed on the label. |
|
public |
Flag for fixing the decimal places to the amount set in Slider.decPlaces. |
|
public |
Sets the HTML base id of the slider and label element. |
|
public |
Raw label element obtained by jQuery. |
|
public |
Sets the maximum value of the slider. |
|
public |
Sets the minimum value of the slider. |
|
public |
Stores a copy of the current color. |
|
public |
Raw slider element obtained by document.getElementById. |
|
public |
Sets the starting position of the slider. |
|
public |
Sets the units that the slider will use. |
|
public |
Sets the current value of the slider. |
Method Summary
Public Methods | ||
public |
Enable or disable the slider. |
|
public |
Get the current value of the slider. |
|
public |
Sets a value in the slider. |
|
public |
Change the color of the slider. |
|
public |
Sets a value in the label. |
Public Constructors
Public Members
public callback: function source
Sets a callback for when the slider changes value. Default value is undefined.
public callbackArgs: * source
Sets the arguments passed to the callback function set in Slider.callback. Default value is undefined.
public clone: dom.Input source
Creates a Dom element from the cloned Input. This value the user inputs is validated to always be a number.
public color: string source
Sets the color in HEX format of the slider. Default value is COLORS.RED.
public decPlaces: number source
Sets the amount of decimal places displayed on the label. Default value is 1.
public fixPlaces: boolean source
Flag for fixing the decimal places to the amount set in Slider.decPlaces. Default value is false.
public id: string source
Sets the HTML base id of the slider and label element. In order for the slider to match with a label, the id must be the same for both elements. The ending changes depending if it is a slider or a label. This class will look for the id: {id}_slider and {id}_label, where id is this value. Default value is "".
Public Methods
public enabled(state: boolean) source
Enable or disable the slider. When the slider is disabled the color changes to COLORS.GRAY. Once it changes back to enabled, its previous color is restored.
Params:
Name | Type | Attribute | Description |
state | boolean | Desired state of the slider. |
public set(value: number) source
Sets a value in the slider. This modifies the value in the label.
Params:
Name | Type | Attribute | Description |
value | number | Desired value to set in the slider. |