Commit aa118065 authored by Sam Saccone's avatar Sam Saccone

Use more idiomatic filter method on CompositeView

parent 8f563309
......@@ -106,12 +106,9 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
this.listenTo(App.request('filterState'), 'change:filter', this.render, this);
},
addChild: function (child) {
filter: function (child) {
var filteredOn = App.request('filterState').get('filter');
if (child.matchesFilter(filteredOn)) {
Backbone.Marionette.CompositeView.prototype.addChild.apply(this, arguments);
}
return child.matchesFilter(filteredOn);
},
onRender: function () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment