Shift to input boxes because of the multiline issue;

This prevents duplication; and enter key behaves as expected;
This commit is contained in:
Abhishek Das
2013-04-06 02:07:41 +05:30
parent ae1421597f
commit 872341231c
5 changed files with 12 additions and 16 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ var app = app || {};
});
var a = taskView.render();
this.$el.append(a.el);
a.$input.focus();
//a.$input.focus();
console.log(a.$input.prop('selectionStart'));
}
+3 -3
View File
@@ -11,7 +11,7 @@ var app = app || {};
'click .task': 'edit',
'blur .edit': 'close',
'keyup .edit': 'broadcast',
'keypress .edit': 'add'
'keypress .edit': 'update'
},
initialize: function() {
@@ -46,11 +46,11 @@ var app = app || {};
});
},
add: function(e) {
update: function(e) {
if ( e.which === ENTER_KEY ) {
app.Tasks.add({content:''});
this.$input.blur();
//this.next('textarea').focus();
this.$el.next('li').find('input').focus();
}
},