const Model = {
addTask: function (timestamp: string, description: string) {
- document.getElementById("tasks")!.appendChild(this.createTask(timestamp, description)).focus();
- },
-
- createTask: function (timestamp: string, description: string) {
const task = document.createElement("div");
task.appendChild(document.createTextNode(description));
task.setAttribute("class", "task");
task.setAttribute("tabindex", "0");
task.setAttribute("data-created", timestamp);
- return task;
+ document.getElementById("tasks")!.appendChild(task);
+ task.focus();
},
destroyTask: function (createTimestamp: string) {