add comment to monitor block listener filtering of events

This commit is contained in:
DD Liu 2017-05-10 11:22:03 -04:00
parent 26a5098347
commit 97bfc90351

View file

@ -350,6 +350,8 @@ class VirtualMachine extends EventEmitter {
* @param {!Blockly.Event} e Any Blockly event.
*/
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) {
this.runtime.monitorBlocks.blocklyListen(e, this.runtime);
}