diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-21 16:00:39 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-10-21 16:00:39 +0200 |
commit | 967d8ca786f57d1cad86dc1c7d1f2dc99b9ae7f7 (patch) | |
tree | 844c9c57bebdc43f7008e845493a84ffac450388 /js/codeq/robot.js | |
parent | fbcca83fc33f3a622364ae90c5d82bbbdc9a9dc6 (diff) |
Show a spinner on hint/test buttons when clicked
Diffstat (limited to 'js/codeq/robot.js')
-rw-r--r-- | js/codeq/robot.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/js/codeq/robot.js b/js/codeq/robot.js index a1b76f1..be164ee 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -14,7 +14,7 @@ jqAllQuadrants = jqDescription.add(jqCode).add(jqConsole).add(jqInfo), // all the quadrants // buttons jqBtnPlan = jqScreen.find('.btn-plan'), - jqBtnHint = jqScreen.find('.btn-hint'), + jqBtnHint = jqScreen.find('.btn-hint').ladda(), jqBtnRun = jqScreen.find('.btn-run'), jqBtnStop = jqScreen.find('.btn-stop'), jqInfoButtons = jqBtnPlan.add(jqBtnHint), // all info-focusing buttons @@ -199,7 +199,7 @@ } }); jqBtnHint.on('click', function () { - var doc = editor.getDoc(); + jqBtnHint.ladda('start'); codeq.comms.sendHint({ 'language': 'robot', 'program': editor.getDoc().getValue(), @@ -215,6 +215,9 @@ } }) .fail(commError) + .fin(function () { + jqBtnHint.ladda('stop'); + }) .done(); }); jqBtnRun.on('click', function () { |