diff options
| author | Georgios Andreadis <G.Andreadis@student.tudelft.nl> | 2017-02-17 09:25:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-17 09:25:26 +0100 |
| commit | 30fb1767715f347246368b7f2462ccfae9413330 (patch) | |
| tree | 2bf5bf335ee210aa46a3f0b7c57aff2653c41a83 | |
| parent | 50fcb0634c9ebe894988103184d50d372bc76907 (diff) | |
| parent | 594cdbbe36881f31b2bd7c9da49f8b42be3f6683 (diff) | |
Merge pull request #5 from tudelft-atlarge/fix-experiment-btn
Fix button handler being triggered multiple times
| -rw-r--r-- | src/scripts/controllers/simulationcontroller.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/scripts/controllers/simulationcontroller.ts b/src/scripts/controllers/simulationcontroller.ts index bb46575c..2652d5d4 100644 --- a/src/scripts/controllers/simulationcontroller.ts +++ b/src/scripts/controllers/simulationcontroller.ts @@ -297,7 +297,11 @@ export class SimulationController { }); }); - $("#new-experiment-btn").click(() => { + let newExperimentBtn = $("#new-experiment-btn"); + // Remove previously added event handlers + newExperimentBtn.off(); + + newExperimentBtn.click(() => { const nameInput = $("#new-experiment-name-input"); if (nameInput.val() === "") { $(".experiment-name-alert").show(); |
