From 36f296d9d63112db4218cef39f1eebc8a61c785d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Dura-Kov=C3=A1cs?= Date: Fri, 4 Dec 2020 09:37:39 +0100 Subject: [PATCH] Set domain to filter by default when creating new mailbox (#3887) --- data/web/js/site/mailbox.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index 68a5ad45..cbf01935 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -125,6 +125,18 @@ $(document).ready(function() { } }); }); + // Add Mailbox Modal + var addMailboxModalShown = false; + $('#addMailboxModal').on('show.bs.modal', function(e) { + if (addMailboxModalShown) { + return; + } + addMailboxModalShown = true; + var $domainSelect = $("#mailbox_table select"); + if ($domainSelect[0].selectedIndex > 0) { // not "All Domains" + $("#addSelectDomain").val($domainSelect.val()).change().selectpicker("render"); + } + }); // Log modal $('#dnsInfoModal').on('show.bs.modal', function(e) { var domain = $(e.relatedTarget).data('domain');