添加openModal调试日志

为了诊断弹窗不显示的问题,在openModal函数中添加:
1. 检查元素是否存在
2. 打印元素信息
3. 打印classList

位置: templates/index.html 第1697-1712行

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-12-10 17:28:36 +08:00
parent 398cd5c9cf
commit dab97c25e1

View File

@@ -1694,8 +1694,22 @@
}
// ==================== 通用函数 ====================
function openModal(id) { document.getElementById(id).classList.add('active'); }
function closeModal(id) { document.getElementById(id).classList.remove('active'); }
function openModal(id) {
const element = document.getElementById(id);
console.log('[openModal] 打开弹窗:', id, '元素:', element);
if (element) {
element.classList.add('active');
console.log('[openModal] 已添加active类, classList:', element.classList);
} else {
console.error('[openModal] 未找到元素:', id);
}
}
function closeModal(id) {
const element = document.getElementById(id);
if (element) {
element.classList.remove('active');
}
}
function showToast(message, type) {
type = type || 'info';