Simplify Block factory init.

This commit is contained in:
Neil Fraser
2015-10-04 17:41:59 -07:00
parent 90e3ccb2b7
commit 8fb16b61a3

View File

@@ -771,11 +771,8 @@ function init() {
BlocklyStorage.retrieveXml(window.location.hash.substring(1),
mainWorkspace);
} else {
var rootBlock = Blockly.Block.obtain(mainWorkspace, 'factory_base');
rootBlock.initSvg();
rootBlock.render();
rootBlock.setMovable(false);
rootBlock.setDeletable(false);
var xml = '<xml><block type="factory_base" deletable="false" movable="false"></block></xml>';
Blockly.Xml.domToWorkspace(mainWorkspace, Blockly.Xml.textToDom(xml));
}
mainWorkspace.addChangeListener(updateLanguage);