Class JsView
A single view instance
Defined in: js_view.js.
Constructor Attributes | Constructor Name and Description |
---|---|
JsView()
|
Method Attributes | Method Name and Description |
---|---|
<static> |
JsView.activate()
reactivate event listening on this view
|
<static> |
JsView.cssForInstance(instance, prePend)
given an instance of a model, give the recommended instance class
|
<static> |
JsView.deactivate()
quiets all events on this view, your callbacks will
not get called
|
<static> |
JsView.div(className, opts)
helper function to spit out divs
|
<static> |
JsView.domCollections()
return all the various collections of dom elements that have the appropriate classes
|
<static> |
JsView.elementsFromInstance(instance)
given an instance, return the relevent elements
|
<static> |
JsView.imageTag(src, opts)
helper function to spit out imageTag
|
<static> |
JsView.modelCSS(prePend)
return the CSS class for the model associated with this view
|
Class Detail
JsView()
MBX.JsView.create({ model: MBX.DesktopUpload, onCreate: function (upload) { //create the upload }, onChange: function (upload) { // any upload changes }, onDestroy: function (upload) { // handle destroys } });
Method Detail
<static>
JsView.activate()
reactivate event listening on this view
<static>
JsView.cssForInstance(instance, prePend)
given an instance of a model, give the recommended instance class
- Parameters:
- instance
- prePend
<static>
JsView.deactivate()
quiets all events on this view, your callbacks will
not get called
<static>
JsView.div(className, opts)
helper function to spit out divs
- Parameters:
- {String} className
- the classes you want to add to the div
- {Object} opts
- (optional) any opts to pass to new Element
- Returns:
- div DOM element
<static>
{Array}
JsView.domCollections()
return all the various collections of dom elements that have the appropriate classes
- Returns:
- {Array} array of extended dom elements that match collection CSS
<static>
{Array}
JsView.elementsFromInstance(instance)
given an instance, return the relevent elements
- Parameters:
- {JsModel#instance} instance
- the instance you want to find elements
- Returns:
- {Array} an array of extended dom elements that match the relevent class names
<static>
JsView.imageTag(src, opts)
helper function to spit out imageTag
- Parameters:
- {String} src
- the url for the image
- {Object} opts
- (optional) any opts to pass to new Element
- Returns:
- img DOM element
<static>
JsView.modelCSS(prePend)
return the CSS class for the model associated with this view
- Parameters:
- {String} prePend
- any string to prepend to the model
- See:
- MBX.JsView.modelCSS