From 5abce170ddf6091160efb6e74afd95f3b16bdff5 Mon Sep 17 00:00:00 2001 From: arlen Date: Tue, 5 Oct 2021 09:24:54 -0400 Subject: [PATCH 1/2] Close popups on click outside (CO-2236) --- app/templates/element/javascript.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index 53b06a0bc..11181a1a3 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -112,11 +112,18 @@ } }); - // Hide custom user menu items on click outside + // Click outside behaviors $(document).on('click', function (e) { + // Hide custom user menu items on click outside if ($(e.target).closest("#user-panel").length === 0) { $("#user-panel").hide(); } + // Hide popovers on click outside but don't close current popover when interacting with content inside it + $('#content [data-original-title]').each(function () { + if (!$(this).is(e.target) && $('.popover.show').has(e.target).length === 0) { + $(this).popover('hide'); + } + }); }); // TOP SEARCH FILTER FORM @@ -173,9 +180,7 @@ $("select").addClass("form-control"); // Enable Bootstrap Popovers. Unless needed elsewhere, constrain this to #content - $(function () { - $('#content [data-toggle="popover"]').popover() - }); + $('#content [data-toggle="popover"]').popover(); // Other buttons (jQuery) $(".addbutton").button({ From d692de520add632f06b41361536d12355d710961 Mon Sep 17 00:00:00 2001 From: arlen Date: Tue, 5 Oct 2021 09:38:36 -0400 Subject: [PATCH 2/2] Make popup selector consistent (CO-2236) --- app/templates/element/javascript.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index 11181a1a3..cf5eb81e5 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -119,7 +119,7 @@ $("#user-panel").hide(); } // Hide popovers on click outside but don't close current popover when interacting with content inside it - $('#content [data-original-title]').each(function () { + $('#content [data-toggle="popover"]').each(function () { if (!$(this).is(e.target) && $('.popover.show').has(e.target).length === 0) { $(this).popover('hide'); }