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
this.blocks[block.id] = block;
// Push block id to stacks array. New blocks are always a stack even if only
// momentary. If the new block is added to an existing stack this stack will
// be removed by the `moveBlock` method below.
if (!opt_isFlyoutBlock) {
// Push block id to stacks array.
// Blocks are added as a top-level stack if they are marked as a topBlock
// (if they were top-level XML in the event) and if they are not
// flyout blocks.
if (!opt_isFlyoutBlock && block.topBlock) {
this._addStack(block.id);
}
};