etcgroup / text-prizm

3 stars 0 forks source link

add LoadingItemView and tests #71

Closed michaelbrooks closed 11 years ago

michaelbrooks commented 11 years ago

LoadingItemView extends Marionette.ItemView to provide state management when the model backing the view needs to be configured (i.e. fetched) before it can be rendered. Until the model's change event triggers, a nice spinner is displayed using spin.js.

This abstracts the functionality that I recently added to the DataSummaryView in pull #68, i.e. ad792728b822773d8770692bdff8f09aacc8e535

To use this, you'd extend this view, and probably implement the onModelChanged() function in your view, which should probably call render(). That should be about it.

Included tests, which currently pass.

geosoco commented 11 years ago

overall, this looks good!

nice idea to automagically handle the spinner.