From 003e5239b899c8a7f18ac93fd93614ca166695c6 Mon Sep 17 00:00:00 2001 From: bochard Date: Wed, 11 Jun 2025 20:34:59 +0800 Subject: [PATCH] added a task search feature --- TODO.TXT | 3 +-- includes/dashboard.php | 7 ++++--- js/search.js | 14 ++++++++++++++ js/tasks.js | 10 +++++++++- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 js/search.js diff --git a/TODO.TXT b/TODO.TXT index 76f2474..a34c85e 100644 --- a/TODO.TXT +++ b/TODO.TXT @@ -2,6 +2,5 @@ -add a session timer when user logged in -don't give direct access to paths esp. when usr. is not logged in or that path must not be accessible -add a short animation loading progress bar when user did some actions to a task --create 'task sorting' feature --create 'task search' feature +-create 'task sorting' feature (not now, maybe when im not lazy to change a lot of code) -when popup is open, the main window will be unaccessible \ No newline at end of file diff --git a/includes/dashboard.php b/includes/dashboard.php index 453db94..01ab04a 100644 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -51,11 +51,11 @@
- - + `; taskBody.appendChild(div); @@ -109,6 +110,7 @@ function addTask(){ console.log('Message:', data.message); setTimeout(function(){ loadTasks(); + removeSearchInput(); }, 500); setDisabledAttributesOnDeleteBtn(); setDisabledAttributesOnEditBtn(); @@ -147,6 +149,7 @@ function editTask(){ console.log(data); setTimeout(function(){ loadTasks(); + removeSearchInput(); }, 500); setDisabledAttributesOnEditBtn(); popupEditTaskClose(); @@ -174,6 +177,7 @@ function deleteTask(){ console.log('Message:', data.message); setTimeout(function(){ loadTasks(); + removeSearchInput(); }, 500); setDisabledAttributesOnDeleteBtn(); }) @@ -223,6 +227,10 @@ function popupEditTaskClose(){ popupWindow.style.visibility = 'hidden'; } +function removeSearchInput(){ + document.getElementById('search').value = ''; +} + // event listeners document.getElementById('new-task-popup-open').addEventListener('click', function(){ -- 2.39.5