summaryrefslogtreecommitdiff
path: root/src/scripts/controllers/simulationcontroller.ts
diff options
context:
space:
mode:
authorGeorgios Andreadis <G.Andreadis@student.tudelft.nl>2017-02-17 09:25:26 +0100
committerGitHub <noreply@github.com>2017-02-17 09:25:26 +0100
commit30fb1767715f347246368b7f2462ccfae9413330 (patch)
tree2bf5bf335ee210aa46a3f0b7c57aff2653c41a83 /src/scripts/controllers/simulationcontroller.ts
parent50fcb0634c9ebe894988103184d50d372bc76907 (diff)
parent594cdbbe36881f31b2bd7c9da49f8b42be3f6683 (diff)
Merge pull request #5 from tudelft-atlarge/fix-experiment-btn
Fix button handler being triggered multiple times
Diffstat (limited to 'src/scripts/controllers/simulationcontroller.ts')
-rw-r--r--src/scripts/controllers/simulationcontroller.ts6
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();