Commit 842d1dfa authored by Aaron Boushley's avatar Aaron Boushley

Removed bindall usage in favor of passing context to bind.

parent c3ff4f6c
...@@ -102,9 +102,8 @@ $(function(){ ...@@ -102,9 +102,8 @@ $(function(){
// a one-to-one correspondence between a **Todo** and a **TodoView** in this // a one-to-one correspondence between a **Todo** and a **TodoView** in this
// app, we set a direct reference on the model for convenience. // app, we set a direct reference on the model for convenience.
initialize: function() { initialize: function() {
_.bindAll(this, 'render', 'close', 'remove'); this.model.bind('change', this.render, this);
this.model.bind('change', this.render); this.model.bind('destroy', this.remove, this);
this.model.bind('destroy', this.remove);
}, },
// Re-render the contents of the todo item. // Re-render the contents of the todo item.
...@@ -170,14 +169,13 @@ $(function(){ ...@@ -170,14 +169,13 @@ $(function(){
// collection, when items are added or changed. Kick things off by // collection, when items are added or changed. Kick things off by
// loading any preexisting todos that might be saved in *localStorage*. // loading any preexisting todos that might be saved in *localStorage*.
initialize: function() { initialize: function() {
_.bindAll(this, 'addOne', 'addAll', 'render', 'toggleAllComplete');
this.input = this.$("#new-todo"); this.input = this.$("#new-todo");
this.allCheckbox = this.$("#toggle-all")[0]; this.allCheckbox = this.$("#toggle-all")[0];
Todos.bind('add', this.addOne); Todos.bind('add', this.addOne, this);
Todos.bind('reset', this.addAll); Todos.bind('reset', this.addAll, this);
Todos.bind('all', this.render); Todos.bind('all', this.render, this);
this.$footer = this.$('footer'); this.$footer = this.$('footer');
this.$main = $('#main'); this.$main = $('#main');
......
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