Skip to content

Commit

Permalink
Remove shadowed clear function from todo models.
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Sep 22, 2012
1 parent 6d0a7fd commit b785a59
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions examples/todos/todos.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,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();
}

});
Expand Down Expand Up @@ -131,9 +126,9 @@ $(function(){
// Close the `"editing"` mode, saving changes to the todo.
close: function() {
var value = this.input.val();
if (!value){
if (!value) {
this.clear();
}else{
} else {
this.model.save({title: value});
this.$el.removeClass("editing");
}
Expand All @@ -146,7 +141,7 @@ $(function(){

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

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

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

Expand Down

0 comments on commit b785a59

Please sign in to comment.