From a0f0eba59dd07c30f2c01681547819f3deca688e Mon Sep 17 00:00:00 2001 From: Gurbinder Singh <26441580+gurbindersingh@users.noreply.github.com> Date: Sun, 6 Oct 2024 09:44:05 +0200 Subject: [PATCH] Fix: Controls not working after reset --- src/main.ts | 2 -- src/render.ts | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0c611a0..aaf82fd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,13 +2,11 @@ import "./style/main.css"; import { createProjection } from "./projection"; import { drawChart } from "./chart"; import { renderControls, renderFootnotes } from "./render"; -import { setupEventListeners } from "./setup"; import { inputs, toggleInputErrorHints } from "./inputs"; const startTime = Date.now(); renderControls(); renderFootnotes(); -setupEventListeners(); const data = createProjection(); drawChart(data); inputs.forEach(input => toggleInputErrorHints(input.id, input.isValid())) diff --git a/src/render.ts b/src/render.ts index 24e6d46..0ec55f2 100644 --- a/src/render.ts +++ b/src/render.ts @@ -1,5 +1,6 @@ import { settings } from "./settings"; import { inputs } from "./inputs"; +import { setupEventListeners } from "./setup"; function renderControls() { let footnoteCounter = 1; @@ -54,6 +55,8 @@ function renderControls() { document.getElementById("controls")!.innerHTML = `

Inputs

` + inputElements + resetButton; + + setupEventListeners(); } function renderFootnotes() {