aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/static/js/console.js
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-18 14:35:15 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-18 14:35:15 +0800
commitdc59c7d18975a744ceac484eccf25225ef4ab583 (patch)
tree0bf258b881d8b8b8316ff20ffe080516e9d0bb2f /fg21sim/webui/static/js/console.js
parent89c1a1835b090408e571dbdfc07fe820d8474557 (diff)
downloadfg21sim-dc59c7d18975a744ceac484eccf25225ef4ab583.tar.bz2
webui: console.js: Disable the "Start" button when task started
Diffstat (limited to 'fg21sim/webui/static/js/console.js')
-rw-r--r--fg21sim/webui/static/js/console.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/fg21sim/webui/static/js/console.js b/fg21sim/webui/static/js/console.js
index 6392b96..86062a7 100644
--- a/fg21sim/webui/static/js/console.js
+++ b/fg21sim/webui/static/js/console.js
@@ -200,9 +200,16 @@ $(document).ready(function () {
* Start the simulation task on the server
*/
$("#task-start").on("click", function () {
+ var button = $(this);
if ($("#conf-status").data("validity")) {
+ button.disable(true);
+ console.log("Disable button:", button[0]);
updateTaskStatus({running: true, finished: false});
startServerTask(ajax_url)
+ .always(function () {
+ button.disable(false);
+ console.log("Enable button:", button[0]);
+ })
.done(function () {
getServerTaskStatus(ajax_url)
.done(function (response) {