Use socketio for syncing task changes across clients

This commit is contained in:
Abhishek Das
2013-03-30 18:10:12 +05:30
parent 0485272d93
commit 4bb398353e
502 changed files with 206510 additions and 64 deletions
+18 -3
View File
@@ -5,15 +5,30 @@ var app = app || {};
app.ListView = Backbone.View.extend({
el: $("#main .children"),
initialize: function(initialTasks) {
this.collection = new app.List(initialTasks);
this.render();
events: {
'click #add': 'addTask'
},
initialize: function() {
this.collection = new app.List();
this.collection.fetch();
this.render();
this.listenTo(this.collection, 'add', this.renderTask);
},
addTask: function() {
console.log('yes');
//var view = new app.TaskView({model: task})
},
render: function() {
this.collection.each(function(task) {
this.renderTask(task);
}, this);
},
renderTask: function(task) {
var taskView = new app.TaskView({
model: task