2

I am making a web based coding games, so I am using blockly so kids can drag and drop to program their games. I was able to customize few things on the editor using my own JavaScript and CSS. But I want the feature to toggle the toolbox, so there will be more space to see the blocks.

I tried hiding the toolbox with JavaScript like this.

$(".blocklyToolboxDiv").css("display", "none");

But the problem is whenever I drag a block to that empty space it got removed. Is there any way I could tell blockly to do not remove blocks dragged over the toolbox?

blockly toolbox image

Jeeva
  • 3,975
  • 3
  • 23
  • 47

1 Answers1

0

You may access the toolbox_ element of the workspace variable which contains methods to show, hide, open categories etc.

workspacePlayground.toolbox_.setVisible(false);
Ruslan López
  • 4,433
  • 2
  • 26
  • 37