Commit 8fb16b61 authored by Neil Fraser's avatar Neil Fraser

Simplify Block factory init.

parent 90e3ccb2
...@@ -771,11 +771,8 @@ function init() { ...@@ -771,11 +771,8 @@ function init() {
BlocklyStorage.retrieveXml(window.location.hash.substring(1), BlocklyStorage.retrieveXml(window.location.hash.substring(1),
mainWorkspace); mainWorkspace);
} else { } else {
var rootBlock = Blockly.Block.obtain(mainWorkspace, 'factory_base'); var xml = '<xml><block type="factory_base" deletable="false" movable="false"></block></xml>';
rootBlock.initSvg(); Blockly.Xml.domToWorkspace(mainWorkspace, Blockly.Xml.textToDom(xml));
rootBlock.render();
rootBlock.setMovable(false);
rootBlock.setDeletable(false);
} }
mainWorkspace.addChangeListener(updateLanguage); mainWorkspace.addChangeListener(updateLanguage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment