Skip to content

Commit

Permalink
merging the jcoglan's patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jul 29, 2011
2 parents f399b04 + f77033d commit 89bdddd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/todos/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ $(function(){
// Toggle the `done` state of this todo item.
toggle: function() {
this.save({done: !this.get("done")});
},

// Remove this Todo from *localStorage* and delete its view.
clear: function() {
this.destroy();
this.view.remove();
}

});
Expand Down Expand Up @@ -103,7 +97,7 @@ $(function(){
// app, we set a direct reference on the model for convenience.
initialize: function() {
this.model.bind('change', this.render, this);
this.model.view = this;
this.model.bind('destroy', this.remove, this);
},

// Re-render the contents of the todo item.
Expand Down Expand Up @@ -152,7 +146,7 @@ $(function(){

// Remove the item, destroy the model.
clear: function() {
this.model.clear();
this.model.destroy();
}

});
Expand Down Expand Up @@ -231,7 +225,7 @@ $(function(){

// Clear all done todo items, destroying their models.
clearCompleted: function() {
_.each(Todos.done(), function(todo){ todo.clear(); });
_.each(Todos.done(), function(todo){ todo.destroy(); });
return false;
},

Expand Down

0 comments on commit 89bdddd

Please sign in to comment.