Skip to content

Commit

Permalink
Merge pull request #309 from tf/subset-collection-fixes
Browse files Browse the repository at this point in the history
Improve SubsetCollection
  • Loading branch information
tf committed Jun 23, 2015
2 parents 4103c26 + 5c6df7d commit e14cdc8
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -16,10 +16,14 @@ pageflow.SubsetCollection = Backbone.Collection.extend({

this.listenTo(this.parent, 'add', function(model, collection, options) {
if (!adding && this.filter(model)) {
this.add(model, collection, options);
this.add(model, options);
}
});

this.listenTo(this.parent, 'remove', function(model) {
this.remove(model);
});

this.listenTo(this, 'add', function(model, collection, options) {
adding = true;
this.parent.add(model);
Expand Down

0 comments on commit e14cdc8

Please sign in to comment.