Add Create, Delete, and Change events.

Not counting change for mutators.
This commit is contained in:
Neil Fraser
2016-01-20 19:11:03 -08:00
parent 36fe3994c9
commit c429949a4e
17 changed files with 209 additions and 78 deletions

View File

@@ -463,20 +463,6 @@ Blockly.WorkspaceSvg.prototype.highlightBlock = function(id) {
setTimeout(function() {thisWorkspace.traceOn(true);}, 1);
};
/**
* Fire a change event for this workspace. Changes include new block, dropdown
* edits, mutations, connections, etc. Groups of simultaneous changes (e.g.
* a tree of blocks being deleted) are merged into one event.
* Applications may hook workspace changes by listening for
* 'blocklyWorkspaceChange' on workspace.getCanvas().
*/
Blockly.WorkspaceSvg.prototype.fireChangeEvent = function() {
if (this.rendered && this.svgBlockCanvas_) {
var details = {workspace: this.id};
Blockly.Events.fire(details);
}
};
/**
* Paste the provided block onto the workspace.
* @param {!Element} xmlBlock XML block element.
@@ -691,7 +677,6 @@ Blockly.WorkspaceSvg.prototype.cleanUp_ = function() {
}
// Fire an event to allow scrollbars to resize.
Blockly.fireUiEvent(window, 'resize');
this.fireChangeEvent();
};
/**