From 7b9a06a90a5e39b968743bcb67b9b2e6d01acada Mon Sep 17 00:00:00 2001 From: Fawzi Mahmoud Date: Sun, 3 Dec 2023 09:43:19 -0600 Subject: [PATCH] UI bug fixes --- public/js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index 459e33f..b14b60c 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -9,6 +9,7 @@ document.addEventListener('DOMContentLoaded', function() { event.preventDefault(); loadProjects(); hideCreateProjectForm(); + hideCreateTaskForm(); }); // Event listener for the 'Create Project' link @@ -133,10 +134,9 @@ function attachProjectClickHandlers() { projectLink.addEventListener('click', function(event) { event.preventDefault(); const projectId = this.getAttribute('data-projectid'); - console.log("Clicked project ID:", this.getAttribute('data-projectid')); - currentProjectId = this.getAttribute('data-projectid'); - fetchTasksForProject(currentProjectId); - showCreateTaskForm(); + console.log("Clicked project ID:", projectId); + fetchTasksForProject(projectId); + showCreateTaskForm(projectId); // Pass projectId to the function showBackButton(); }); });