Created
September 19, 2013 20:42
-
-
Save wookiehangover/6629545 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onFilterComplete_: function(collection){ | |
if( this.isLoaded() && !this.loading_ ){ | |
var newItems = _.difference( | |
_.pluck(collection.models, 'cid'), | |
_.keys(this.itemCardViews_) | |
); | |
// empty collections or collections with any unrendered items should be | |
// re-rendered, otherwise return early | |
if( collection.length !== 0 && | |
this.renderCount_ === collection.length && | |
newItems.length === 0 | |
){ | |
return; | |
} | |
console.debug(this.cid + ' re-rendering due to filter change'); | |
this.renderCount_ = 0; | |
this.$('.items.main').empty(); | |
this.renderItemList_(); | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment