diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-11-18 19:39:28 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-11-18 19:39:28 +0100 |
commit | a184ad0a8a36c94669b6e07c311f4177a38edb63 (patch) | |
tree | 700a7ddfeec039d3fe43bfd6f352d047ffbee935 /js/codeq | |
parent | 6893733a646d9e697b85feef39dc047c70dd601c (diff) |
Disable editor while waiting for hint/test results
Diffstat (limited to 'js/codeq')
-rw-r--r-- | js/codeq/prolog.js | 4 | ||||
-rw-r--r-- | js/codeq/python.js | 4 | ||||
-rw-r--r-- | js/codeq/robot.js | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 47a88b2..565e0ce 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -247,6 +247,7 @@ } }); jqBtnHint.on('click', function () { + editor.setOption('readOnly', true); terminal.inputDisable(); jqBtnTest.prop('disabled', true); jqBtnHint.ladda('start'); @@ -266,6 +267,7 @@ }) .fail(commError) .fin(function () { + editor.setOption('readOnly', false); terminal.inputEnable(); jqBtnHint.ladda('stop'); jqBtnTest.prop('disabled', false); @@ -273,6 +275,7 @@ .done(); }); jqBtnTest.on('click', function () { + editor.setOption('readOnly', true); terminal.inputDisable(); jqBtnHint.prop('disabled', true); jqBtnTest.ladda('start'); @@ -292,6 +295,7 @@ }) .fail(commError) .fin(function () { + editor.setOption('readOnly', false); terminal.inputEnable(); jqBtnTest.ladda('stop'); jqBtnHint.prop('disabled', false); diff --git a/js/codeq/python.js b/js/codeq/python.js index 3c4caef..fc826a8 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -207,6 +207,7 @@ } }); jqBtnHint.on('click', function () { + editor.setOption('readOnly', true); jqBtnTest.prop('disabled', true); jqBtnHint.ladda('start'); codeq.comms.sendHint({ @@ -225,12 +226,14 @@ }) .fail(commError) .fin(function () { + editor.setOption('readOnly', false); jqBtnHint.ladda('stop'); jqBtnTest.prop('disabled', false); }) .done(); }); jqBtnTest.on('click', function () { + editor.setOption('readOnly', true); jqBtnHint.prop('disabled', true); jqBtnTest.ladda('start'); codeq.comms.sendTest({ @@ -249,6 +252,7 @@ }) .fail(commError) .fin(function () { + editor.setOption('readOnly', false); jqBtnTest.ladda('stop'); jqBtnHint.prop('disabled', false); }) diff --git a/js/codeq/robot.js b/js/codeq/robot.js index 88e889d..a6748dc 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -203,6 +203,7 @@ } }); jqBtnHint.on('click', function () { + editor.setOption('readOnly', true); jqBtnHint.ladda('start'); codeq.comms.sendHint({ 'language': 'robot', @@ -220,6 +221,7 @@ }) .fail(commError) .fin(function () { + editor.setOption('readOnly', false); jqBtnHint.ladda('stop'); }) .done(); |