Handle opening a dialogue to configure scale data.
- Source:
- Copyright:
- 2015 Adrian Greeve
- 2015 Adrian Greeve
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(inner) Reference :Dialogue
to the popup.
Type:
- Dialogue
(inner) scaleid :Number
Current scale ID.
Type:
- Number
(inner) scalevalues :Array
ID and name of the scales.
Type:
- Array
(inner) The :String
select box selector.
Type:
- String
(inner) The :String
hidden field selector.
Type:
- String
(inner) The :String
trigger selector.
Type:
- String
(inner) {Number)
Methods
(inner) getScaleValues(scaleid) → {Promise}
Get the scale values for the selected scale.
Parameters:
Name | Type | Description |
---|---|---|
scaleid |
Number | The scale ID of the selected scale. |
Returns:
A deffered object with the scale values.
- Type
- Promise
(inner) init(selectSelector, inputSelector, triggerSelector) → {ScaleConfig}
Main initialisation.
Parameters:
Name | Type | Description |
---|---|---|
selectSelector |
String | The select box selector. |
inputSelector |
String | The hidden input field selector. |
triggerSelector |
String | The trigger selector. |
Returns:
A new instance of ScaleConfig.
- Type
- ScaleConfig
(inner) initScaleConfig(popup)
Initialises the scale configuration dialogue.
Parameters:
Name | Type | Description |
---|---|---|
popup |
Dialogue | Dialogue object to initialise. |
(inner) retrieveOriginalScaleConfig() → {Object|String}
Gets the original scale configuration if it was set.
Returns:
scale configuration or empty string.
- Type
- Object | String
(inner) scaleChangeHandler(e)
Triggered when a scale is selected.
Parameters:
Name | Type | Description |
---|---|---|
e |
Event |
(inner) setScaleConfig()
Set the scale configuration back into a JSON string in the hidden element.
(inner) showConfig()
Displays the scale configuration dialogue.