function hideToolboxUI() {
const toolbox = document.getElementsByClassName('blocklyToolboxDiv')[0];
if (toolbox) {
toolbox.style.display = 'none';
}
const workspaceBox = document.getElementsByClassName('blocklyWorkspaceBox')[0];
if (workspaceBox) {
workspaceBox.style.left = '0';
}
const blocklyDiv = document.getElementById('blocklyDiv');
if (blocklyDiv) {
const mainWorkspace = Blockly.getMainWorkspace();
mainWorkspace.resize();
}
}
That works fine, until I also tried to disable the "move" option on the canvas by disabling the scrollbar interaction. Then I'm left with an usable whitespace on the left of my canvas, which would usually be occupied by the toolbox. I believe this is due to this transform being added dynamically by Blockly:
<g class="blocklyBlockCanvas" transform="translate(121,0) scale(1)">...</g>
Is there something I can do about this, or is there a better way to hide the toolbox categories from the canvas, while keeping the remainder of the toolbox functional?
2. "End" toolbox position issue
I tried to avoid the above issue by setting the toolboxPosition to "end". However, that completely broke my Blockly interactions. After setting this option, whenever I drag a block from the toolbox onto the canvas, it always goes straight in the bin. Same when I move any existing block. Did I break this option with my "hideToolboxUI()" function above?
3. Padding for the canvas
Is there a way to tell Blockly to maintain a padding of the blocks to the edges of the canvas? I'd basically like the (0, 0) coordinate to be offset by a couple of pixels, so that by default not all blocks bump right into the edge of my web view (and into other user interface elements).
Thank you very much in advance for guidance on any of these.
Adrian
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/4d497612-1705-4877-9b38-96e66280f47cn%40googlegroups.com.