lsendel / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Enhancement Request: Event on modification #65

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

So we've found ourselves needing an event for when the Blockly is modified so 
we can save the data to the server side seemlessly. 

Right now we've done this in a very hackish using jQuery way by firing 

$(document).trigger("blockly_modified")

in the following functions. 

Blockly.block.onMouseUp_
Blockly.block.render

We essentially want to know at what point Blockly has been modified in a way 
that would necessitate saving the blockly XML

Thanks,

Dave

Original issue reported on code.google.com by dtyre...@gmail.com on 8 Aug 2012 at 8:24

GoogleCodeExporter commented 8 years ago
Listen to the following event: 'blocklyWorkspaceChange'
On this object: Blockly.mainWorkspace.getCanvas()

It's a recent addition and not yet undocumented anywhere.
http://code.google.com/p/blockly/source/detail?r=364

Original comment by neil.fra...@gmail.com on 8 Aug 2012 at 8:38