Skip to content

Commit

Permalink
Merge pull request #1596 from fancyoung/patch-1.
Browse files Browse the repository at this point in the history
  • Loading branch information
braddunbar committed Sep 22, 2012
2 parents 7bfce6f + 74ec1e5 commit 6d0a7fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/todos/todos.js
Expand Up @@ -131,9 +131,12 @@ $(function(){
// Close the `"editing"` mode, saving changes to the todo.
close: function() {
var value = this.input.val();
if (!value) this.clear();
this.model.save({title: value});
this.$el.removeClass("editing");
if (!value){
this.clear();
}else{
this.model.save({title: value});
this.$el.removeClass("editing");
}
},

// If you hit `enter`, we're through editing the item.
Expand Down

0 comments on commit 6d0a7fd

Please sign in to comment.