From 1c77a18c121b3da3368438e211769bb170da8b2b Mon Sep 17 00:00:00 2001 From: Thomas Wood <thomas.wood09@imperial.ac.uk> Date: Tue, 29 Mar 2016 19:24:08 +0100 Subject: [PATCH] Run code after selecting/loading --- navig-driver.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/navig-driver.js b/navig-driver.js index e2464b1..63b1dc1 100644 --- a/navig-driver.js +++ b/navig-driver.js @@ -99,6 +99,7 @@ function setSourceCode(text) { $("#source_code").val(text); if (source !== null) { source.setValue(text); + buttonRunHandler(); } } @@ -203,11 +204,13 @@ $("#navigation_step").change(function(e) { stepTo(n); }); -$("#button_run").click(function() { +function buttonRunHandler() { var message = readSourceParseAndRun(); $("#action_output").html(message); var timeoutID = window.setTimeout(function() { $("#action_output").html(""); }, 1000); -}); +}; + +$("#button_run").click(buttonRunHandler); $("#button_reset").click(function() { reset(); }); // stepTo(0); -- GitLab