mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-07-25 13:00:17 +08:00
Shift to input boxes because of the multiline issue;
This prevents duplication; and enter key behaves as expected;
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user