diff --git a/Lab01/app/templates/tasks.tmpl b/Lab01/app/templates/tasks.tmpl
index b384c6d..63789d0 100644
--- a/Lab01/app/templates/tasks.tmpl
+++ b/Lab01/app/templates/tasks.tmpl
@@ -12,7 +12,7 @@
@@ -41,6 +41,19 @@
const tasksEl = document.getElementById("tasks");
const descriptionInput = document.getElementById("description");
let tasks = [];
+ let timer;
+
+ document.getElementById("search").addEventListener('keyup', e => {
+ const enteredText = e.currentTarget.value;
+ clearTimeout(timer);
+ if (e.key === "Enter ") {
+ searchTask(enteredText);
+ } else {
+ timer = setTimeout(() => {
+ searchTask(enteredText);
+ }, 1000);
+ }
+ });
function submitForm(formData) {
axios.post("/tasks", formData, axiosConfig)
@@ -71,6 +84,12 @@
});
}
+ function searchTask(value) {
+ if (value !== "") {
+ console.log(value);
+ }
+ }
+
function addTaskToTasks(task, number) {
tasks.push(task);
const newTask = document.createElement('div');