左侧导航栏样式做到了统一
This commit is contained in:
@@ -255,22 +255,17 @@
|
||||
window.location.href = `main.html?page=model-compare-chat&id=${compareTaskId}`;
|
||||
}
|
||||
|
||||
// 绑定重新提问按钮点击事件
|
||||
function bindRestartBtn() {
|
||||
const restartBtn = document.getElementById('restartBtn');
|
||||
if (restartBtn) {
|
||||
restartBtn.onclick = restartQuestion;
|
||||
}
|
||||
}
|
||||
|
||||
// 页面加载完成后初始化
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initPage);
|
||||
document.addEventListener('DOMContentLoaded', bindRestartBtn);
|
||||
} else {
|
||||
// 通过 main.html fetch 加载时,直接绑定
|
||||
setTimeout(bindRestartBtn, 0);
|
||||
setTimeout(initPage, 0);
|
||||
initPage();
|
||||
}
|
||||
|
||||
// 直接绑定按钮点击事件(不依赖 DOMContentLoaded,因为页面可能通过 fetch 加载)
|
||||
const restartBtn = document.getElementById('restartBtn');
|
||||
if (restartBtn) {
|
||||
restartBtn.onclick = restartQuestion;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user