Skip to content

Instantly share code, notes, and snippets.

@michalkozminski
Created December 10, 2013 08:50
Show Gist options
  • Save michalkozminski/7887556 to your computer and use it in GitHub Desktop.
Save michalkozminski/7887556 to your computer and use it in GitHub Desktop.
Backbone.Router.extend({
routes:{
'*filter': 'setFilter'
},
setFilter: function( param ) {
// Set the current filter to be used
window.app.TodoFilter = param.trim() || '';
// Trigger a collection filter event, causing hiding/unhiding
// of Todo view items
window.app.Todos.trigger('filter');
}
});
app.TodoRouter = new Workspace();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment