Add workspace.clearUndo

This commit is contained in:
Neil Fraser
2016-03-25 19:03:18 -07:00
parent 65a25ffb7e
commit 05fc1ad91b
9 changed files with 240 additions and 177 deletions

View File

@@ -327,10 +327,12 @@ Graph.resize = function() {
*/
Graph.init = function() {
Graph.workspace = Blockly.inject('blocklyDiv',
{media: '../../media/',
{collapse: false,
media: '../../media/',
toolbox: document.getElementById('toolbox')});
Blockly.Xml.domToWorkspace(Graph.workspace,
document.getElementById('startBlocks'));
Graph.workspace.clearUndo();
// When Blockly changes, update the graph.
Graph.workspace.addChangeListener(Graph.drawVisualization);