mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
add comment to monitor block listener filtering of events
This commit is contained in:
parent
26a5098347
commit
97bfc90351
1 changed files with 2 additions and 0 deletions
|
@ -350,6 +350,8 @@ class VirtualMachine extends EventEmitter {
|
||||||
* @param {!Blockly.Event} e Any Blockly event.
|
* @param {!Blockly.Event} e Any Blockly event.
|
||||||
*/
|
*/
|
||||||
monitorBlockListener (e) {
|
monitorBlockListener (e) {
|
||||||
|
// Filter events by type, since monitor blocks only need to listen to these events.
|
||||||
|
// Monitor blocks shouldn't be destroyed when flyout blocks are deleted.
|
||||||
if (['create', 'change'].indexOf(e.type) !== -1) {
|
if (['create', 'change'].indexOf(e.type) !== -1) {
|
||||||
this.runtime.monitorBlocks.blocklyListen(e, this.runtime);
|
this.runtime.monitorBlocks.blocklyListen(e, this.runtime);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue