mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-06-27 16:00:04 +08:00
Task gets added but not saved; Fix it
This commit is contained in:
@@ -11,7 +11,7 @@ var app = app || {};
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
this.collection = new app.List();
|
||||
app.Tasks = this.collection = new app.List();
|
||||
this.collection.fetch();
|
||||
this.listenTo(this.collection, 'add', this.renderTask);
|
||||
},
|
||||
|
||||
@@ -48,7 +48,11 @@ var app = app || {};
|
||||
|
||||
add: function(e) {
|
||||
if ( e.which === ENTER_KEY ) {
|
||||
console.log('Add stuff here');
|
||||
this.$input.blur();
|
||||
var task = new app.Task({content:''});
|
||||
var taskView = new app.TaskView({model:task}).render();
|
||||
taskView.$el.insertAfter(this.$el);
|
||||
taskView.$input.focus();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user