summaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2021-06-23 11:45:13 +0300
committermoisseev <moiseev@mezonplus.ru>2021-06-23 11:45:13 +0300
commita881e460062d8487d439011b5ddab2b70485fbf5 (patch)
tree4255b1211c6823b4feb3b51e85205ca80219a4dc /interface
parentdd139891f6bd9f49c0489880ef78e59d8d109521 (diff)
downloadrspamd-a881e460062d8487d439011b5ddab2b70485fbf5.tar.gz
rspamd-a881e460062d8487d439011b5ddab2b70485fbf5.zip
[Minor] Dismiss popover by clicking outside
Diffstat (limited to 'interface')
-rw-r--r--interface/js/app/rspamd.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js
index 171812a0c..711ec1971 100644
--- a/interface/js/app/rspamd.js
+++ b/interface/js/app/rspamd.js
@@ -468,6 +468,19 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
custom_locale = $(localeTextbox).val();
validateLocale(true);
});
+
+ // Dismiss Bootstrap popover by clicking outside
+ $("body").on("click", function (e) {
+ $(".popover").each(function () {
+ if (
+ // Popover's descendant
+ $(this).has(e.target).length ||
+ // Button (or icon within a button) that triggers the popover.
+ $(e.target).closest("button").attr("aria-describedby") === this.id
+ ) return;
+ $(this).popover("hide");
+ });
+ });
}());
$("#selData").change(function () {