-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Show Categories that use custom code to load (variables, procedures) #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/util/filter-toolbox.js
Outdated
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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this 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.
src/util/filter-toolbox.js
Outdated
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.
Sorry, something went wrong.
Fixed! |
There was a problem hiding this 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!
…edures) (scratchfoundation#483)" This reverts commit 739c5de.
* 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.
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.