diff --git a/www/app.js b/www/app.js index b48fff3..92943ad 100644 --- a/www/app.js +++ b/www/app.js @@ -231,7 +231,8 @@ function openConversation(id) { const fileInput = document.getElementById('fileInput'); if (attachBtn) { - attachBtn.addEventListener('click', () => { + attachBtn.addEventListener('click', (e) => { + e.stopPropagation(); // 阻止冒泡到 document attachPanel.classList.toggle('show'); }); } @@ -239,7 +240,7 @@ function openConversation(id) { // 点击其他地方关闭面板 document.addEventListener('click', (e) => { if (attachPanel && attachPanel.classList.contains('show') && - !attachPanel.contains(e.target) && e.target !== attachBtn) { + !attachPanel.contains(e.target) && !attachBtn.contains(e.target)) { attachPanel.classList.remove('show'); } }); diff --git a/www/index.html b/www/index.html index 7df9df2..b313289 100644 --- a/www/index.html +++ b/www/index.html @@ -8,12 +8,12 @@ AI助手 - +
- - + + \ No newline at end of file