Update runtime's handling of delete for new blocks structure

This commit is contained in:
Tim Mickel 2016-06-06 14:53:59 -04:00
parent 285c2792ef
commit 18e4228399

View file

@ -168,14 +168,11 @@ Runtime.prototype.deleteBlock = function (e) {
this.deleteBlock({id: block.next});
}
// Delete substacks and fields
for (var field in block.fields) {
if (field === 'SUBSTACK') {
this.deleteBlock({id: block.fields[field].value});
} else {
for (var shadow in block.fields[field].blocks) {
this.deleteBlock({id: shadow});
}
// Delete inputs (including substacks)
for (var input in block.inputs) {
// If it's null, the block in this input moved away.
if (block.inputs[input].block !== null) {
this.deleteBlock({id: block.inputs[input].block});
}
}