diff --git a/core/events.js b/core/events.js index f78222d03..ac78aa3a3 100644 --- a/core/events.js +++ b/core/events.js @@ -802,10 +802,10 @@ Blockly.Events.disableOrphans = function(event) { var block = workspace.getBlockById(event.blockId); if (block) { if (block.getParent() && !block.getParent().disabled) { - do { - block.setDisabled(false); - block = block.getNextBlock(); - } while (block); + var children = block.getDescendants(); + for (var i = 0, child; child = children[i]; i++) { + child.setDisabled(false); + } } else if ((block.outputConnection || block.previousConnection) && Blockly.dragMode_ == Blockly.DRAG_NONE) { do {