添加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:
@@ -1694,8 +1694,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ==================== 通用函数 ====================
|
// ==================== 通用函数 ====================
|
||||||
function openModal(id) { document.getElementById(id).classList.add('active'); }
|
function openModal(id) {
|
||||||
function closeModal(id) { document.getElementById(id).classList.remove('active'); }
|
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) {
|
function showToast(message, type) {
|
||||||
type = type || 'info';
|
type = type || 'info';
|
||||||
|
|||||||
Reference in New Issue
Block a user