fix: expose modal functions to window object
This commit is contained in:
@@ -257,12 +257,16 @@
|
||||
document.getElementById('modal').classList.add('show');
|
||||
}
|
||||
|
||||
window.showModal = showModal;
|
||||
|
||||
function hideModal() {
|
||||
document.getElementById('modal').classList.remove('show');
|
||||
document.getElementById('projectName').value = '';
|
||||
document.getElementById('projectDesc').value = '';
|
||||
}
|
||||
|
||||
window.hideModal = hideModal;
|
||||
|
||||
async function createProject() {
|
||||
const name = document.getElementById('projectName').value.trim();
|
||||
const desc = document.getElementById('projectDesc').value.trim();
|
||||
@@ -289,12 +293,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
window.createProject = createProject;
|
||||
|
||||
function enterProject(projectId) {
|
||||
// Store selected project and redirect to workbench
|
||||
localStorage.setItem('currentProject', projectId);
|
||||
window.location.href = '/workbench.html';
|
||||
}
|
||||
|
||||
window.enterProject = enterProject;
|
||||
|
||||
// Close modal on overlay click
|
||||
document.getElementById('modal').addEventListener('click', (e) => {
|
||||
if (e.target.id === 'modal') hideModal();
|
||||
|
||||
Reference in New Issue
Block a user