-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (40 loc) · 1.11 KB
/
script.js
File metadata and controls
52 lines (40 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const taskManager = new TaskManager();
taskManager.renderTasks();
$("#add-task-dialog").dialog({
autoOpen: false,
width: 500, // Set the dialog's width as desired
});
$(".add-task").click(() => {
console.log("first");
$("#add-task-dialog").dialog("open");
// taskManager.renderTasks();
});
$("#submit-btn").click(() => {
const taskNote = $("#task-note").val();
const taskTitle = $("#task-title").val();
const taskDescription = $("#task-description").val();
const taskAssigness = $("#task-assignedTo").val().split(",");
let taskStatus = "todo";
taskManager.addTask({
note: taskNote,
title: taskTitle,
description: taskDescription,
assignees: taskAssigness,
status: taskStatus,
isEditing: false,
});
$("#add-task-dialog").dialog("close");
taskManager.renderTasks();
console.log(taskAssigness);
});
$("#cancel-btn").click(() => {
$("#add-task-dialog").dialog("close");
});
$("#search-input").on("input", function () {
const searchQuery = $(this).val();
if (searchQuery != "") {
taskManager.filterTasks(searchQuery);
} else {
taskManager.renderTasks();
}
});