]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Dismiss popover by clicking outside 3805/head
authormoisseev <moiseev@mezonplus.ru>
Wed, 23 Jun 2021 08:45:13 +0000 (11:45 +0300)
committermoisseev <moiseev@mezonplus.ru>
Wed, 23 Jun 2021 08:45:13 +0000 (11:45 +0300)
interface/js/app/rspamd.js

index 171812a0c50b4743d72a63fcce3c64ab938dddc2..711ec197133cb87bc9cdc0cf6958cae3c0b19177 100644 (file)
@@ -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 () {