Hi,
I am not sure which code you need.
If you want to show/hide a specific category.
var toolbox = Blockly.getMainWorkspace().toolbox_;
var categoryID = "category_logic";
var items = toolbox.getToolboxItems();
for (let item of items) {
if (item.toolboxItemDef_.id==categoryID) {
toolbox.setSelectedItem(item);
setTimeout(function() {
toolbox.clearSelection();
}, 3000);
break;
}
};
If you want to show/hide the toolbox.
var toolbox = document.getElementsByClassName("blocklyToolboxDiv blocklyNonSelectable")[0];
if (toolbox) {
toolbox.style.display=toolbox.style.display=="none"?"block":"none";
Blockly.getMainWorkspace().resize();
}
Hope this helps.