From e88b28c8bd2cf2c955b7751686cc2a0ac551eb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Tue, 7 Jul 2026 11:07:34 +0800 Subject: [PATCH] Add files via upload --- web/static/js/audit.js | 13 +++++++++++-- web/templates/index.html | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/web/static/js/audit.js b/web/static/js/audit.js index 44e323f8..a252df1e 100644 --- a/web/static/js/audit.js +++ b/web/static/js/audit.js @@ -771,9 +771,16 @@ document.addEventListener('languagechange', function () { var auditCustomSelectMap = {}; var auditFilterSelectsDocListener = false; +function closeAuditCustomSelect(selectId) { + var reg = auditCustomSelectMap[selectId]; + if (reg && reg.wrapper) { + reg.wrapper.classList.remove('open'); + } +} + function closeAllAuditCustomSelects() { Object.keys(auditCustomSelectMap).forEach(function (id) { - auditCustomSelectMap[id].wrapper.classList.remove('open'); + closeAuditCustomSelect(id); }); } @@ -872,13 +879,15 @@ function enhanceAuditFilterSelect(selectId) { dropdown.addEventListener('click', function (e) { var opt = e.target.closest('.audit-custom-select-option'); if (!opt) return; + e.stopPropagation(); var val = opt.getAttribute('data-value'); if (val === null) val = ''; + closeAuditCustomSelect(selectId); if (select.value !== val) { select.value = val; select.dispatchEvent(new Event('change', { bubbles: true })); } - wrapper.classList.remove('open'); + closeAuditCustomSelect(selectId); syncAuditCustomSelect(selectId); }); diff --git a/web/templates/index.html b/web/templates/index.html index 08eabe0d..996f188e 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -3816,7 +3816,7 @@