new task redone
This commit is contained in:
parent
2d64d6ca63
commit
6db5e9c7c8
@ -18,14 +18,13 @@ function new_task() {
|
||||
let template = $("#task-template").html();
|
||||
template = $(template);
|
||||
$.post("/v1/new", {api_key: API_KEY, content: input.val()}, function(data) {
|
||||
// $("#new-task").before("<li><input type='checkbox' id='task-" + data.task.id + "' onchange='check(" + data.task.id + ")'> " + data.task.content + "</li>");
|
||||
let input = $("input", template);
|
||||
input.prop("id", "task-" + data.task.id);
|
||||
// input.prop("onchange", "check('" + data.task.id + "')");
|
||||
input.change(function() {
|
||||
check(data.task.id);
|
||||
});
|
||||
input.after(data.task.content); // NOTE not sure if will work
|
||||
input.next().replace(" " + data.task.content);
|
||||
$("#new-task").before(template);
|
||||
})
|
||||
.fail(function(request) {
|
||||
|
Loading…
Reference in New Issue
Block a user