Skip to content

Commit

Permalink
Fix: Controls not working after reset
Browse files Browse the repository at this point in the history
  • Loading branch information
gurbindersingh committed Oct 6, 2024
1 parent 9bdd2c4 commit a0f0eba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
3 changes: 3 additions & 0 deletions src/render.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { settings } from "./settings";
import { inputs } from "./inputs";
import { setupEventListeners } from "./setup";

function renderControls() {
let footnoteCounter = 1;
Expand Down Expand Up @@ -54,6 +55,8 @@ function renderControls() {

document.getElementById("controls")!.innerHTML =
`<h3 class="is-sr-only">Inputs</h3>` + inputElements + resetButton;

setupEventListeners();
}

function renderFootnotes() {
Expand Down

0 comments on commit a0f0eba

Please sign in to comment.