Skip to content

Conversation

TheBrokenRail
Copy link
Contributor

Resolves

More of scratchfoundation/scratch-gui#16

Proposed Changes

If a category uses the "custom" tag to generate blocks don't delete in the filtered toolbox

Reason for Changes

So you can use thins like variables and custom blocks.

@rschamp rschamp self-assigned this Feb 28, 2017
@rschamp rschamp self-requested a review February 28, 2017 16:58
@rschamp rschamp added this to the March 23 milestone Feb 28, 2017
if (category.nodeName.toLowerCase() !== 'category') continue;
var filteredCategory = filterToolboxNode(category, opcodes);
if (filteredCategory.hasChildNodes()) filteredToolbox.appendChild(filteredCategory);
if (!filteredCategory.hasChildNodes() && filteredCategory.hasAttribute("custom")) filteredToolbox.appendChild(filteredCategory);

This comment was marked as abuse.

This comment was marked as abuse.

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TheBrokenRail, nice catch. I have a suggestion to simplify this but looks like a good way to do it.

if (category.nodeName.toLowerCase() !== 'category') continue;
var filteredCategory = filterToolboxNode(category, opcodes);
if (filteredCategory.hasChildNodes()) filteredToolbox.appendChild(filteredCategory);
if (!filteredCategory.hasChildNodes() && filteredCategory.hasAttribute("custom")) filteredToolbox.appendChild(filteredCategory);

This comment was marked as abuse.

@TheBrokenRail
Copy link
Contributor Author

Fixed!

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @TheBrokenRail!

@rschamp rschamp merged commit 739c5de into scratchfoundation:develop Mar 1, 2017
rschamp pushed a commit to rschamp/scratch-vm that referenced this pull request Mar 9, 2017
rschamp added a commit that referenced this pull request Mar 9, 2017
* Revert "Merge pull request #486 from rschamp/fix-filter-tests"

This reverts commit ba00db8, reversing
changes made to 739c5de.

* Revert "Show Categories that use custom code to load (variables, procedures) (#483)"

This reverts commit 739c5de.

* Revert "Merge pull request #461 from rschamp/filter-toolbox"

This reverts commit 343b5bf, reversing
changes made to 370f2c6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants