From aa400ea15bbccd0fcc9f0a1ef39c7f52ab09cd5a Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Wed, 27 Jun 2018 15:53:18 -0400 Subject: [PATCH] Show extension status button via XML attr not button (#1270) --- src/engine/runtime.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 266e2ce87..f34ccb604 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -497,6 +497,7 @@ class Runtime extends EventEmitter { const categoryInfo = { id: extensionInfo.id, name: maybeFormatMessage(extensionInfo.name), + showStatusButton: extensionInfo.showStatusButton, blockIconURI: extensionInfo.blockIconURI, menuIconURI: extensionInfo.menuIconURI, color1: extensionInfo.colour || '#FF6680', @@ -547,15 +548,6 @@ class Runtime extends EventEmitter { } } - // Add extension status button - if (extensionInfo.showStatusButton) { - categoryInfo.blocks.push({ - info: {}, - json: null, - xml: `` - }); - } - for (const blockInfo of extensionInfo.blocks) { if (blockInfo === '---') { categoryInfo.blocks.push(ConvertedSeparator); @@ -854,7 +846,13 @@ class Runtime extends EventEmitter { const menuIconXML = menuIconURI ? `iconURI="${menuIconURI}"` : ''; - xmlParts.push(``); + let statusButtonXML = ''; + if (categoryInfo.showStatusButton) { + statusButtonXML = 'showStatusButton="true"'; + } + + xmlParts.push(``); xmlParts.push.apply(xmlParts, paletteBlocks.map(block => block.xml)); xmlParts.push(''); }