Merge branch 'requirejs' of https://github.com/floydpraveen/HackFlowy into floydpraveen-requirejs

Conflicts:
	public/index.html
	public/javascripts/views/task.js
	server.js
This commit is contained in:
Abhishek Das
2013-08-25 12:03:45 +05:30
15 changed files with 1937 additions and 66 deletions
+19 -7
View File
@@ -1,8 +1,18 @@
var app = app || {};
define(
['jquery',
'backbone',
'collections/list',
'views/task'
],
(function() {
function(
$,
Backbone,
List,
TaskView
) {
app.ListView = Backbone.View.extend({
var ListView = Backbone.View.extend({
el: $("#main .children"),
@@ -11,7 +21,7 @@ var app = app || {};
},
initialize: function() {
app.Tasks = this.collection = new app.List();
Tasks = this.collection = new List();
this.collection.fetch();
this.listenTo(this.collection, 'add', this.renderTask);
},
@@ -23,7 +33,7 @@ var app = app || {};
},
renderTask: function(task) {
var taskView = new app.TaskView({
var taskView = new TaskView({
model: task
});
var a = taskView.render();
@@ -33,6 +43,8 @@ var app = app || {};
this.$el.append(a.el);
}
});
});
}());
return ListView;
});