From c746a7e3239f1f667818e5fd3c7b0f819b32e109 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Sat, 8 Aug 2026 13:36:22 +0530 Subject: [PATCH] Close I1 quick action popups on outside click --- .../employees/work_engagement_board.html | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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 %}