From 1410ed67f2b9c56d34a7822e11a132fe6c4fba70 Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Wed, 2 Apr 2014 11:14:54 +0200 Subject: [PATCH 1/2] According to the documentation it should be possible to trigger the filter event on a collection to enforce a refilter of a collection bound to a CollectionViewHelper (with an itemFilter). Added handling of the filter event of a collection bound to a CollectionViewHelper --- src/collection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/collection.js b/src/collection.js index c7c9d550..7e142d82 100644 --- a/src/collection.js +++ b/src/collection.js @@ -431,6 +431,7 @@ Thorax.CollectionView.on({ collection: { reset: onCollectionReset, sort: onCollectionReset, + filter: applyVisibilityFilter, change: function(model) { var options = this.getObjectOptions(this.collection); if (options && options.change) { From 015ac12522ab5a9f7eddb64239a58112f1f4288d Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Thu, 3 Apr 2014 23:35:29 +0200 Subject: [PATCH 2/2] According to the Backbone documentation, the success handler of fetch gets the parameters collection, response and options. The options parameter is not forwarded by thorax. Forward the options parameter to the success handler. http://backbonejs.org/#Collection-fetch --- src/collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/collection.js b/src/collection.js index 7e142d82..591d4926 100644 --- a/src/collection.js +++ b/src/collection.js @@ -33,9 +33,9 @@ Thorax.Collection = Backbone.Collection.extend({ fetch: function(options) { options = options || {}; var success = options.success; - options.success = function(collection, response) { + options.success = function(collection, response, options) { collection._fetched = true; - success && success(collection, response); + success && success(collection, response, options); }; return _fetch.apply(this, arguments); },