From 4aea29c3f614d26710eb7a35cdac4361a6d98e6b Mon Sep 17 00:00:00 2001 From: Katrina Wheelan Date: Mon, 29 Jul 2024 15:16:56 -0400 Subject: [PATCH] fix welcome page bug --- src/js/views/00_welcome.js | 8 ++++---- src/js/views/08_summary.js | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/js/views/00_welcome.js b/src/js/views/00_welcome.js index 7a97ae8..c16b037 100644 --- a/src/js/views/00_welcome.js +++ b/src/js/views/00_welcome.js @@ -20,10 +20,10 @@ export class WelcomeView extends View { Welcome.show(); // initialize links in buttons - document.getElementById('step-upload').addEventListener('click', visitPage('upload')); - document.getElementById('step-initiatives').addEventListener('click', visitPage('new-inits')) - document.getElementById('step-revenue').addEventListener('click', visitPage('revenue')) - document.getElementById('step-finish').addEventListener('click', visitPage('summary')) + document.getElementById('step-upload').addEventListener('click', () => visitPage('upload')); + document.getElementById('step-initiatives').addEventListener('click', () => visitPage('new-inits')); + document.getElementById('step-revenue').addEventListener('click', () => visitPage('revenue')); + document.getElementById('step-finish').addEventListener('click', () => visitPage('summary')); } diff --git a/src/js/views/08_summary.js b/src/js/views/08_summary.js index 88267f7..7ecce7e 100644 --- a/src/js/views/08_summary.js +++ b/src/js/views/08_summary.js @@ -7,6 +7,7 @@ import { formatCurrency } from '../utils/common_utils.js'; import { View } from "./view_class.js"; import Prompt from "../components/prompt/prompt.js"; import { downloadXLSX } from "../utils/XLSX_handlers.js"; +import WelcomeView from './00_welcome.js'; export function compareToTarget(){ const baseline = new Baseline; @@ -22,7 +23,10 @@ export function compareToTarget(){ Prompt.show(); } -const returnToWelcome = () => {visitPage('welcome')}; +function returnToWelcome() { + const welcome = new WelcomeView(); + welcome.visit(); +}; export class SummaryView extends View {