From ffb06c2247bb7f7524a3941863523c6b9c0db7d9 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Thu, 16 Apr 2026 12:27:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20inline=20onclick=20?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=85=B3=E9=97=AD=E6=A8=A1=E6=80=81=E6=A1=86?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E5=8F=AF=E9=9D=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/static/app.js | 16 +++++++--------- web/static/index.html | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index 9a87195..0ba1f55 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -8,17 +8,15 @@ var refreshTimer = null; document.addEventListener('DOMContentLoaded', function() { loadConfig(); refreshAll(); - - // 点击模态框背景关闭 - document.querySelectorAll('.modal').forEach(function(modal) { - modal.addEventListener('click', function(e) { - if (e.target === modal) { - modal.classList.remove('active'); - } - }); - }); }); +// 点击模态框背景关闭 +function closeModalOnBackground(event, modalId) { + if (event.target.id === modalId) { + document.getElementById(modalId).classList.remove('active'); + } +} + function loadConfig() { fetch(API_BASE + '/api/config') .then(function(res) { return res.json(); }) diff --git a/web/static/index.html b/web/static/index.html index 58abf50..fd7d64d 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -156,8 +156,8 @@ -