Only add to stacks if topLevel is true in CREATE

This commit is contained in:
Tim Mickel 2016-06-06 14:53:42 -04:00
parent e5b677c7f6
commit 285c2792ef

View file

@ -91,10 +91,11 @@ Runtime.prototype.createBlock = function (block, opt_isFlyoutBlock) {
// Create new block // Create new block
this.blocks[block.id] = block; this.blocks[block.id] = block;
// Push block id to stacks array. New blocks are always a stack even if only // Push block id to stacks array.
// momentary. If the new block is added to an existing stack this stack will // Blocks are added as a top-level stack if they are marked as a topBlock
// be removed by the `moveBlock` method below. // (if they were top-level XML in the event) and if they are not
if (!opt_isFlyoutBlock) { // flyout blocks.
if (!opt_isFlyoutBlock && block.topBlock) {
this._addStack(block.id); this._addStack(block.id);
} }
}; };