From 79b3aede067ae30769f186f779448a0ae8642b98 Mon Sep 17 00:00:00 2001 From: kainoaw Date: Mon, 3 Jun 2024 21:09:31 -0700 Subject: [PATCH 1/3] Fixed bug where tasks could accidently be deleted when taskbar was minimized --- source/homepage/homepage.css | 8 ++++++++ source/homepage/homepage.js | 3 +++ 2 files changed, 11 insertions(+) diff --git a/source/homepage/homepage.css b/source/homepage/homepage.css index 4427495..4610492 100644 --- a/source/homepage/homepage.css +++ b/source/homepage/homepage.css @@ -667,6 +667,14 @@ td .task-div { transform: translateX(-88%); } + .task-wrapper { + display: none; + } + + .task-wrapper.active { + display: block; + } + .main-wrap { transform: translateX(-160px); diff --git a/source/homepage/homepage.js b/source/homepage/homepage.js index ecfae52..76f0d7a 100644 --- a/source/homepage/homepage.js +++ b/source/homepage/homepage.js @@ -671,17 +671,20 @@ function dateQuery() { function clickTaskList() { const taskList = document.querySelector('.task-list'); + const taskWrap = document.querySelector('.task-wrapper'); const outSide = document.querySelector('.main-wrap'); taskList.addEventListener('click', function(event) { if (event.target === taskList) { if (window.innerWidth <= 800) { taskList.classList.toggle('active'); + taskWrap.classList.toggle('active'); } } }); outSide.addEventListener('click', function(){ if (window.innerWidth <= 800) { taskList.classList.remove('active'); + taskWrap.classList.remove('active'); } }); } From 0f07b186eeb2885774a10029a9d07bd96a036b23 Mon Sep 17 00:00:00 2001 From: kainoaw Date: Mon, 3 Jun 2024 21:17:13 -0700 Subject: [PATCH 2/3] Added feature where arrow keys can go to previous and next months/days --- source/calendar/calendar.js | 9 +++++++++ source/homepage/homepage.js | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/source/calendar/calendar.js b/source/calendar/calendar.js index fd445b3..8cb21ac 100644 --- a/source/calendar/calendar.js +++ b/source/calendar/calendar.js @@ -63,6 +63,15 @@ function initButtons(){ // RESIZE WINDOW FOR RESPONSIVENESS window.addEventListener('resize', windowWidth); + + // ARROW KEY EVENT LISTENERS + window.addEventListener('keydown', function(event) { + if (event.key === "ArrowLeft") { + prev(); + } else if (event.key === "ArrowRight") { + next(); + } + }); } /** diff --git a/source/homepage/homepage.js b/source/homepage/homepage.js index 76f0d7a..910c1cf 100644 --- a/source/homepage/homepage.js +++ b/source/homepage/homepage.js @@ -49,6 +49,13 @@ function initButtons() { selectWidget(id.substring(3,5)); }); }); + window.addEventListener('keydown', function(event) { + if (event.key === "ArrowLeft") { + prevDate(); + } else if (event.key === "ArrowRight") { + nextDate(); + } + }); } /** From 24719136ac8f564d5b04da39c011963608a354a7 Mon Sep 17 00:00:00 2001 From: kainoaw Date: Wed, 5 Jun 2024 11:11:36 -0700 Subject: [PATCH 3/3] Added homepage taskscroll fix to calendar --- source/calendar/calendar.css | 14 ++++++++++++-- source/calendar/calendar.html | 8 +++++--- source/calendar/calendar.js | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/source/calendar/calendar.css b/source/calendar/calendar.css index e26decb..e8a54c9 100644 --- a/source/calendar/calendar.css +++ b/source/calendar/calendar.css @@ -52,11 +52,21 @@ select { background-color: white; box-shadow: 1px 1px lightgrey; + /* Set size of task area to be relative to list */ + position: relative; +} + +/* Wrapper for overflow of current tasks */ +.task-wrapper { + position: absolute; + top: 44px; + bottom: 0; + width: 88%; + overflow: auto; + /* Hide scroll-bars for Firefox, Edge */ -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ - - overflow-y: scroll; } /* Hides task list when page reaches certain size */ diff --git a/source/calendar/calendar.html b/source/calendar/calendar.html index c063fb2..8f5e804 100644 --- a/source/calendar/calendar.html +++ b/source/calendar/calendar.html @@ -28,9 +28,11 @@

Tasks

-
    - -
+
+
    + +
+
diff --git a/source/calendar/calendar.js b/source/calendar/calendar.js index 8cb21ac..9fe0643 100644 --- a/source/calendar/calendar.js +++ b/source/calendar/calendar.js @@ -365,7 +365,7 @@ function windowWidth() { * Adds task to task list upon "Add Task" button click. */ async function addTask() { - const taskList = document.querySelector(".task-list"); + const taskList = document.querySelector(".task-container"); const task = document.createElement("li"); task.setAttribute("class", "task"); await task.insertAdjacentHTML("beforeend", `