From 02dd8336417cb89500905e98f954b9c97111096b Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 1 Oct 2015 14:41:47 +0200 Subject: Use 'value' option in CM constructor to set initial content --- js/codeq/robot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/codeq/robot.js') diff --git a/js/codeq/robot.js b/js/codeq/robot.js index f2f4a9b..1752f31 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -193,7 +193,8 @@ jqHints = jqInfo.find('.hints'), editor = codeq.makeEditor(jqEditor[0], { mode: 'python', - indentUnit: 4 + indentUnit: 4, + value: currentSolution || '' }), activityHandler = makeActivityHandler(editor, problemDef.id), terminal = makeRobotTerminalHandler(jqTerminal, editor, problemDef.id, activityHandler), @@ -204,7 +205,6 @@ codeq.tr.registerDictionary('robot', problemDef.translations); codeq.tr.translateDom(jqScreen); - if (currentSolution) editor.setValue(currentSolution); jqBtnPlan.prop('disabled', !hinter.hasNextPlan()); editor.on('change', function (instance, changeObj) { -- cgit v1.2.1