Switch to sending end drag event to be handled by gui

This commit is contained in:
DD 2018-02-23 11:57:19 -05:00
parent 51fd97ee54
commit 8355dd662f
3 changed files with 37 additions and 35 deletions
src/engine

View file

@ -387,6 +387,13 @@ class Runtime extends EventEmitter {
return 'BLOCK_DRAG_UPDATE';
}
/**
* Event name for block drag end.
* @const {string}
*/
static get BLOCK_DRAG_END () {
return 'BLOCK_DRAG_END';
}
/**
* Event name for reporting that an extension was added.
@ -1404,6 +1411,14 @@ class Runtime extends EventEmitter {
this.emit(Runtime.BLOCK_DRAG_UPDATE, areBlocksOverGui);
}
/**
* Emit event to indicate that the block drag has ended with the blocks outside the blocks workspace
* @param {Array.<object>} blocks The set of blocks dragged to the GUI
*/
emitBlockEndDrag (blocks) {
this.emit(Runtime.BLOCK_DRAG_END, blocks);
}
/**
* Emit value for reporter to show in the blocks.
* @param {string} blockId ID for the block.