From 8123099f8655981e3f7984830fe8ca0154b7278e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 1 Mar 2016 15:30:27 +0100 Subject: Clear hints immediately when pressing Plan or Test --- js/codeq/hint.js | 6 ++---- js/codeq/prolog.js | 2 ++ js/codeq/python.js | 2 ++ js/codeq/robot.js | 2 ++ js/codeq/upgrade_to_aai.js | 1 - 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/codeq/hint.js b/js/codeq/hint.js index 0550a41..641c710 100644 --- a/js/codeq/hint.js +++ b/js/codeq/hint.js @@ -386,7 +386,6 @@ along with this program. If not, see . */ if (planIdx < planDef.length) { var jqHintBox = $(''); activityHandler.queueTrace({'typ': 'plan', 'index': planIdx}); - clearHints(); typeHandlers['static'](planDef[planIdx], {'id': 'plan'}, jqHintBox); jqHints.prepend(jqHintBox); jqHintsContainer.scrollTop(0); @@ -411,9 +410,6 @@ along with this program. If not, see . */ jqHintBox = $(''), jqHintBtn; - // clear any existing hints - clearHints(); - // display the test_results hint first if found for (i = 0; i < hints.length; i++) { hint = hints[i]; @@ -450,6 +446,8 @@ along with this program. If not, see . */ jqHintsContainer.scrollTop(0); }, + 'clear': clearHints, + 'destroy': function () { editor.off('update', onEditorUpdate); clearHints(); diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 6e07784..0ae8206 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -220,6 +220,7 @@ along with this program. If not, see . */ }); jqBtnPlan.on('click', function () { + hinter.clear(); if (!hinter.planNext()) { jqBtnPlan.hide(); } @@ -230,6 +231,7 @@ along with this program. If not, see . */ // maintain the illusion var timeout = 500 + Math.random() * 1000; + hinter.clear(); $(editor.getWrapperElement()).addClass('disabled'); editor.setOption('readOnly', 'nocursor'); terminal.inputDisable(); diff --git a/js/codeq/python.js b/js/codeq/python.js index 112d7ff..edf0f46 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -155,6 +155,7 @@ along with this program. If not, see . */ }); jqBtnPlan.on('click', function () { + hinter.clear(); if (!hinter.planNext()) { jqBtnPlan.prop('disabled', true).blur(); } @@ -164,6 +165,7 @@ along with this program. If not, see . */ // maintain the illusion var timeout = 500 + Math.random() * 1000; + hinter.clear(); $(editor.getWrapperElement()).addClass('disabled'); editor.setOption('readOnly', 'nocursor'); terminal.inputDisable(); diff --git a/js/codeq/robot.js b/js/codeq/robot.js index 3e561a1..7bda8ec 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -161,11 +161,13 @@ along with this program. If not, see . */ }); jqBtnPlan.on('click', function () { + hinter.clear(); if (!hinter.planNext()) { jqBtnPlan.prop('disabled', true).blur(); } }); jqBtnHint.on('click', function () { + hinter.clear(); $(editor.getWrapperElement()).addClass('disabled'); editor.setOption('readOnly', 'nocursor'); jqBtnHint.ladda('start'); diff --git a/js/codeq/upgrade_to_aai.js b/js/codeq/upgrade_to_aai.js index a75be22..867c9ea 100644 --- a/js/codeq/upgrade_to_aai.js +++ b/js/codeq/upgrade_to_aai.js @@ -82,5 +82,4 @@ along with this program. If not, see . */ jqPassword.val(''); } }); - })(); -- cgit v1.2.1