diff --git a/app/modules/employees/templates/employees/work_engagement_board.html b/app/modules/employees/templates/employees/work_engagement_board.html index d4044db..e0153ea 100644 --- a/app/modules/employees/templates/employees/work_engagement_board.html +++ b/app/modules/employees/templates/employees/work_engagement_board.html @@ -173,7 +173,7 @@ {% endif %} -
+
! Blocked
@@ -187,7 +187,7 @@
-
+
✕ N/A
@@ -403,6 +403,35 @@ document.addEventListener("click", function (event) { requested.classList.remove("hidden"); } }); + + +document.addEventListener("click", function (event) { + const clickedPopup = event.target.closest("[data-i1-quick-popup]"); + const clickedSummary = event.target.closest("[data-i1-quick-popup] > summary"); + + document.querySelectorAll("[data-i1-quick-popup][open]").forEach(function (popup) { + if (clickedPopup === popup) { + return; + } + popup.removeAttribute("open"); + }); + + if (clickedSummary) { + const popup = clickedSummary.parentElement; + document.querySelectorAll("[data-i1-quick-popup][open]").forEach(function (otherPopup) { + if (otherPopup !== popup) { + otherPopup.removeAttribute("open"); + } + }); + } +}); + +document.addEventListener("keydown", function (event) { + if (event.key !== "Escape") return; + document.querySelectorAll("[data-i1-quick-popup][open]").forEach(function (popup) { + popup.removeAttribute("open"); + }); +}); {% endblock %}