Extends
- Backbone.View
Members
className :string
The HTML classes to use for this view's element
Type:
- string
classes :Object
CSS classes assigned to the HTML elements that make up this view
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
sliderContainer |
string | The element that will be converted by this view into a number slider widget. An element with this class must exist in the template. |
handle |
string | The class given to the element that acts as a handle for the slider UI. The handle is created during render and the class is set by the jquery slider widget. |
range |
string | The class given to the element that shades the slider from 0 to the current opacity. The range is created during render and the class is set by the jquery slider widget. |
label |
string | The element that displays the current opacity value as a percentage. This element is created during render. |
events :Object
The events this view will listen to and the associated function to call.
Type:
- Object
model :MapAsset
The model that this view uses
Type:
template :Underscore.template
The primary HTML template for this view
Type:
- Underscore.template
type :string
The type of View this is
Type:
- string
Methods
initialize(optionsopt)
Executed when a new LayerOpacityView is created
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
A literal object with options to pass to the view |
onClose()
Perform clean-up functions when this view is about to be removed from the page
or navigated away from.
render() → {LayerOpacityView}
Renders this view
Returns:
Returns the rendered view element
- Type
- LayerOpacityView
updateLabel(newOpacity)
Update the label with the newOpacity displayed as a percentage
Parameters:
Name | Type | Description |
---|---|---|
newOpacity |
Number | A number between 0 and 1 indicating the new opacity value for the MapAsset model |
updateModel(newOpacity)
Update the MapAsset model's opacity attribute with a new value.
Parameters:
Name | Type | Description |
---|---|---|
newOpacity |
Number | A number between 0 and 1 indicating the new opacity value for the MapAsset model |
updateSlider()
Get the new opacity value from the model and update the slider handle position
and label. This function is called whenever the model opacity is updated.