Class SpazTimeline
Defined in: spaztimeline.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SpazTimeline(opts)
This object provides an API for managing the content of a timeline Currently this requires jQuery, but that could change or be overwritten on a per-app basis |
Field Attributes | Field Name and Description |
---|---|
the timeline |
|
an array of data items that are represented in the timeline |
Method Attributes | Method Name and Description |
---|---|
addItems(items)
given an array of objects, this will render them and add them to the timeline |
|
append(htmlitem)
|
|
cleanup()
Stuff we should do when we're done using this, including removing event listeners an stopping the refresher |
|
filterItems(selector, type)
|
|
hideItems(selector)
|
|
itemExists(selector)
|
|
onFailure(e, data)
Again, due to scope issues, we define this here to take advantage of the closure |
|
onSuccess(e, data)
Again, due to scope issues, we define this here to take advantage of the closure |
|
prepend(htmlitem)
wrapper for prepending to timeline |
|
refresh()
This is a wrapper function for the refresher interval we define this here and use a closure to solve a scope issue when the interval fires |
|
removeItem(selector)
|
|
removeItems(selector)
|
|
renderItem(item, templatefunc)
|
|
This is the method that gets data from the model and calls addItems() on what is returned |
|
select(selector, container)
This is a wrapper for the selector engine, so someone could swap in their own recipe if necessary. |
|
showItems(selector)
|
|
sortItems(selector, sortfunc)
sorts the elements in the timeline according to the sorting function |
|
start()
call this after initialization |
|
SpazTimeline(opts)
This object provides an API for managing the content of a timeline Currently this requires jQuery, but that could change or be overwritten on a per-app basis
- Parameters:
- opts
- Requires:
- jQuery
addItems(items)
given an array of objects, this will render them and add them to the timeline
- Parameters:
- {array} items
cleanup()
Stuff we should do when we're done using this, including removing event listeners an stopping the refresher
onFailure(e, data)
Again, due to scope issues, we define this here to take advantage of the closure
- Parameters:
- e
- data
onSuccess(e, data)
Again, due to scope issues, we define this here to take advantage of the closure
- Parameters:
- e
- data
refresh()
This is a wrapper function for the refresher interval we define this here and use a closure to solve a scope issue when the interval fires
requestData()
This is the method that gets data from the model and calls addItems() on what is returned
{DOMelement[]} select(selector, container)
This is a wrapper for the selector engine, so someone could swap in their own recipe if necessary. By default we use jQuery, and return the array of HTML elements (not the jQuery object)
- Parameters:
- selector
- container