From e26c00ed0371b681c720f2658f9807fb5e082701 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Fri, 1 Jul 2016 13:42:17 -0700 Subject: [PATCH] Change params of flyout.layout --- core/flyout.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/flyout.js b/core/flyout.js index 2f5130b61..b8c2367f2 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -573,7 +573,9 @@ Blockly.Flyout.prototype.show = function(xmlList) { gaps.push(isNaN(gap) ? this.MARGIN * 3 : gap); } else if (tagName == 'BUTTON') { - contents.push({type: 'button', label: xml.getAttribute('text')}); + var label = xml.getAttribute('text'); + var curButton = new Blockly.FlyoutButton(this.workspace_, label); + contents.push({type: 'button', button: curButton}); gaps.push(this.MARGIN); } } @@ -611,7 +613,7 @@ Blockly.Flyout.prototype.show = function(xmlList) { /** * Lay out the blocks in the flyout. - * @param {!Array.} blocks The blocks to lay out. + * @param {!Array.} contents The blocks and buttons to lay out. * @param {!Array.} gaps The visible gaps between blocks. * @private */ @@ -661,7 +663,7 @@ Blockly.Flyout.prototype.layout_ = function(contents, gaps) { this.addBlockListeners_(root, block, rect); } else if (item.type == 'button') { - var button = new Blockly.FlyoutButton(this.workspace_, item.label); + var button = item.button; var buttonSvg = button.createDom(); button.moveTo(cursorX, cursorY); button.show();