mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 07:29:12 -04:00
Switch to sending end drag event to be handled by gui
This commit is contained in:
parent
51fd97ee54
commit
8355dd662f
3 changed files with 37 additions and 35 deletions
src/engine
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue