diff --git a/src/containers/blocks.jsx b/src/containers/blocks.jsx
index 8f5fb1f16..47d12661c 100644
--- a/src/containers/blocks.jsx
+++ b/src/containers/blocks.jsx
@@ -175,7 +175,7 @@ class Blocks extends React.Component {
// When we change sprites, update the toolbox to have the new sprite's blocks
if (this.props.vm.editingTarget) {
const target = this.props.vm.editingTarget;
- this.props.updateToolboxState(makeToolboxXML(target.id, target.isStage));
+ this.props.updateToolboxState(makeToolboxXML(target.isStage, target.id));
}
if (this.props.vm.editingTarget && !this.state.workspaceMetrics[this.props.vm.editingTarget.id]) {
@@ -202,7 +202,7 @@ class Blocks extends React.Component {
this.ScratchBlocks.defineBlocksWithJsonArray(blocksInfo.map(blockInfo => blockInfo.json));
const dynamicBlocksXML = this.props.vm.runtime.getBlocksXML();
const target = this.props.vm.editingTarget;
- const toolboxXML = makeToolboxXML(target.id, target.isStage, dynamicBlocksXML);
+ const toolboxXML = makeToolboxXML(target.isStage, target.id, dynamicBlocksXML);
this.props.updateToolboxState(toolboxXML);
}
handleCategorySelected (categoryName) {
diff --git a/src/lib/make-toolbox-xml.js b/src/lib/make-toolbox-xml.js
index 928bdd7f1..b0962e1dc 100644
--- a/src/lib/make-toolbox-xml.js
+++ b/src/lib/make-toolbox-xml.js
@@ -2,7 +2,7 @@ const categorySeparator = '';
const blockSeparator = ''; // At default scale, about 28px
-const motion = function (targetId, isStage) {
+const motion = function (isStage, targetId) {
return `
${isStage ? `
@@ -132,7 +132,7 @@ const motion = function (targetId, isStage) {
`;
};
-const looks = function (targetId, isStage) {
+const looks = function (isStage, targetId) {
return `
${isStage ? '' : `
@@ -346,7 +346,7 @@ const events = function () {
`;
};
-const control = function (_targetId, isStage) {
+const control = function (isStage) {
return `
@@ -393,7 +393,7 @@ const control = function (_targetId, isStage) {
`;
};
-const sensing = function (_targetId, isStage) {
+const sensing = function (isStage) {
return `
${isStage ? '' : `
@@ -658,24 +658,24 @@ const xmlOpen = '';
const xmlClose = '';
/**
- * @param {!string} targetId - The current editing target
* @param {!boolean} isStage - Whether the toolbox is for a stage-type target.
+ * @param {!string} targetId - The current editing target
* @param {string?} categoriesXML - null for default toolbox, or an XML string with elements.
* @returns {string} - a ScratchBlocks-style XML document for the contents of the toolbox.
*/
-const makeToolboxXML = function (targetId, isStage, categoriesXML) {
+const makeToolboxXML = function (isStage, targetId, categoriesXML) {
const gap = [categorySeparator];
const everything = [
xmlOpen,
- motion(targetId, isStage), gap,
- looks(targetId, isStage), gap,
- sound(targetId, isStage), gap,
- events(targetId, isStage), gap,
- control(targetId, isStage), gap,
- sensing(targetId, isStage), gap,
- operators(targetId, isStage), gap,
- data(targetId, isStage)
+ motion(isStage, targetId), gap,
+ looks(isStage, targetId), gap,
+ sound(isStage, targetId), gap,
+ events(isStage, targetId), gap,
+ control(isStage, targetId), gap,
+ sensing(isStage, targetId), gap,
+ operators(isStage, targetId), gap,
+ data(isStage, targetId)
];
if (categoriesXML) {
diff --git a/src/reducers/toolbox.js b/src/reducers/toolbox.js
index 19acb12ab..e3317ea85 100644
--- a/src/reducers/toolbox.js
+++ b/src/reducers/toolbox.js
@@ -2,7 +2,7 @@ const UPDATE_TOOLBOX = 'scratch-gui/toolbox/UPDATE_TOOLBOX';
import makeToolboxXML from '../lib/make-toolbox-xml';
const initialState = {
- toolboxXML: makeToolboxXML('', true)
+ toolboxXML: makeToolboxXML(true)
};
const reducer = function (state, action) {