Skip to content
Browse files

issues

  • Loading branch information...
1 parent 507b649 commit a645ddbd501d80b851fbf3745293c529d49d2d3b @jxs committed May 17, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 script/todolist.js
View
6 script/todolist.js
@@ -54,7 +54,6 @@ window.onload =function() {
//view observers on the model
_.bindAll(this, 'render', 'close', 'clear');
this.model.on('destroy', this.clear);
- this.model.on('change:done', this.updateview);
},
render: function() {
var template= _.template($('#item-template').html());
@@ -75,9 +74,6 @@ window.onload =function() {
this.remove();
this.unbind();
},
- updateview:function(){
- App.checkcompleted();
- }
})
var Appview = Backbone.View.extend({
el:$("#todo-app"),
@@ -92,6 +88,8 @@ window.onload =function() {
Todolist.on('reset', this.addAll);
Todolist.on('add',this.addOne);
Todolist.on('add',this.checkcompleted);
+ Todolist.on('remove',this.checkcompleted);
+ Todolist.on('change:done', this.checkcompleted);
Todolist.fetch();
},
createOnEnter:function(e){

0 comments on commit a645ddb

Please sign in to comment.
Something went wrong with that request. Please try again.