Permalink
Browse files

changing filter anchor selection trigger

  • Loading branch information...
1 parent 0c5c4bb commit b65e95cc25bc57e94b53409656799c406d271890 @jsoverson jsoverson committed Aug 25, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 labs/dependency-examples/backbone_marionette_require/js/views/Footer.js
@@ -12,15 +12,16 @@ define(['marionette','vent','templates','views/ActiveCount'], function (Marionet
filters : '#filters a'
},
events : {
- 'click #clear-completed' : 'clearCompletedClick',
- 'click #filters a' : 'onFilterClick'
+ 'click #clear-completed' : 'clearCompletedClick'
+ },
+ initialize : function() {
+ this.bindTo(vent, 'todoList:filter', this.updateFilterSelection, this);
},
onRender : function() {
this.count.show(new ActiveCount({collection : this.collection}));
},
- onFilterClick : function(evt) {
- this.ui.filters.removeClass('selected');
- $(evt.currentTarget).addClass('selected');
+ updateFilterSelection : function(filter) {
+ this.ui.filters.removeClass('selected').filter('[href="#/' + filter + '"]').addClass('selected');
},
clearCompletedClick : function() {
vent.trigger('todoList:clear:completed');

0 comments on commit b65e95c

Please sign in to comment.