From b0ee888c824575c94e75c20cb40312c0aa496311 Mon Sep 17 00:00:00 2001 From: glax Date: Tue, 23 May 2023 16:29:09 +0200 Subject: [PATCH] Exist popup by clicking outside of it --- Website/interaction.js | 5 ++--- Website/style.css | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Website/interaction.js b/Website/interaction.js index 78bbeaa..a2f9f8b 100644 --- a/Website/interaction.js +++ b/Website/interaction.js @@ -30,6 +30,8 @@ const addtaskpopup = document.querySelector("addtask-popup"); const closetaskpopup = document.querySelector("#closePopupImg"); settingsCog.addEventListener("click", () => slide()); +closetaskpopup.addEventListener("click", () => HideNewTaskWindow()) +document.querySelector("addtask-background").addEventListener("click", () => HideNewTaskWindow()); let availableTaskTypes; GetTaskTypes() @@ -107,8 +109,6 @@ function slide(){ slideIn = !slideIn; } - - function ResetContent(){ tasksContent.replaceChildren(); var add = document.createElement("div"); @@ -120,7 +120,6 @@ function ResetContent(){ tasksContent.appendChild(add); } -closetaskpopup.addEventListener("click", () => HideNewTaskWindow()) function ShowNewTaskWindow(){ addtaskpopup.style.display = "block"; addtaskpopup.animate(fadeIn, fadeInTiming); diff --git a/Website/style.css b/Website/style.css index 9bc2e44..1b1f565 100644 --- a/Website/style.css +++ b/Website/style.css @@ -206,7 +206,6 @@ publication img { addtask-popup{ display: none; - opacity: 0; width: 100%; height: 100%; top: 0; @@ -246,7 +245,6 @@ window-titlebar { top: 0; border-radius: 5px 5px 0 0; color: var(--accent-color); - display: flex block; flex-direction: row; justify-content: space-between;