diff --git a/index.html b/index.html
index 8198981..cf32b91 100755
--- a/index.html
+++ b/index.html
@@ -75,7 +75,7 @@
-
+
diff --git a/sumorobot.js b/sumorobot.js
index be09058..bebd61a 100755
--- a/sumorobot.js
+++ b/sumorobot.js
@@ -295,6 +295,8 @@ window.onload = function() {
} else if (event.type == Blockly.Events.DELETE && event.oldXml.getAttributeNode("type").nodeValue == "controls_if") {
/* remove the control_if block id */
controlBlockId = "";
+ /* enable the if condition block */
+ workspace.updateToolbox(document.getElementById("toolbox"));
}
/* only process change and move commands */
@@ -309,14 +311,10 @@ window.onload = function() {
var xml = Blockly.Xml.workspaceToDom(workspace);
localStorage.setItem("sumorobot.currentProgram", Blockly.Xml.domToText(xml));
- /* if control_if is used*/
+ /* if control_if block is used */
if (controlBlockId != "") {
/* disable the if condition block */
workspace.updateToolbox(document.getElementById("toolbox_no_if"));
- /* if no control_if is used */
- } else {
- /* enable the if condition block */
- workspace.updateToolbox(document.getElementById("toolbox"));
}
}