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) { ...@@ -106,12 +106,9 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
this.listenTo(App.request('filterState'), 'change:filter', this.render, this); this.listenTo(App.request('filterState'), 'change:filter', this.render, this);
}, },
addChild: function (child) { filter: function (child) {
var filteredOn = App.request('filterState').get('filter'); var filteredOn = App.request('filterState').get('filter');
return child.matchesFilter(filteredOn);
if (child.matchesFilter(filteredOn)) {
Backbone.Marionette.CompositeView.prototype.addChild.apply(this, arguments);
}
}, },
onRender: function () { 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