diff --git a/public/js/wizard.js b/public/js/wizard.js index bfde63b..789358a 100644 --- a/public/js/wizard.js +++ b/public/js/wizard.js @@ -22,14 +22,14 @@ const App = { async init() { console.log('Initializing WebWizard...'); - + if (!this.state.userId) { await this.initSession(); } await this.loadCategories(); this.bindEvents(); - + // If we don't have a project, try to load existing or create one if (!this.state.project) { await this.loadLastProject(); @@ -70,14 +70,14 @@ const App = { syncSelectionWithProject() { if (this.state.project && this.state.project.wizard_data) { const wd = this.state.project.wizard_data; - + // Step 1 if (wd.business_category) { const bc = wd.business_category; this.state.selection.category = bc.group; this.state.selection.subcategory = bc.subcategory; this.state.selection.customDescription = bc.custom_description || ''; - + if (this.state.selection.category) { this.selectCategory(this.state.selection.category); this.state.selection.subcategory = bc.subcategory; @@ -136,7 +136,7 @@ const App = { if (m.contact_form) { document.getElementById('form-enabled').checked = m.contact_form.enabled; document.getElementById('form-config-container').classList.toggle('hidden', !m.contact_form.enabled); - + if (m.contact_form.mode) { document.querySelector(`input[name="form-mode"][value="${m.contact_form.mode}"]`).checked = true; document.getElementById('config-local').classList.toggle('hidden', m.contact_form.mode !== 'local'); @@ -224,7 +224,7 @@ const App = { bindEvents() { document.getElementById('btn-next').addEventListener('click', () => this.nextStep()); document.getElementById('btn-prev').addEventListener('click', () => this.prevStep()); - + document.getElementById('custom-description').addEventListener('input', (e) => { this.state.selection.customDescription = e.target.value; }); @@ -291,7 +291,7 @@ const App = { const card = document.createElement('div'); card.className = 'category-card'; if (this.state.selection.category === cat.id) card.classList.add('selected'); - + card.innerHTML = `