pull in bootstrap. submit form on enter

This commit is contained in:
ansuz 2017-07-24 16:22:12 +02:00
parent 83f79a3883
commit 3efb9d21f5
2 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
define([
'jquery',
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
//'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
'less!/todo/todo.less',
//'less!/customize/src/less/cryptpad.less',
'less!/customize/src/less/toolbar.less',

View File

@ -48,7 +48,7 @@ define([
.text(new Date(APP.lm.proxy.data[el].ctime).toLocaleString())
.appendTo($taskDiv);
$('<button>', {
'class': 'fa fa-times cp-task-remove'
'class': 'fa fa-times cp-task-remove btn btn-danger'
}).appendTo($taskDiv).on('click', function() {
deleteTask(el);
});
@ -71,7 +71,16 @@ define([
display();
};
$iframe.find('.cp-create-form button').on('click', addTask);
var $formSubmit = $iframe.find('.cp-create-form button').on('click', addTask);
var $input = $iframe.find('#newTodoName').on('keypress', function (e) {
switch (e.which) {
case 13:
$formSubmit.click();
break;
default:
console.log(e.which);
}
});
var editTask = function () {