AI-generated Key Takeaways
-
Blockly workspaces can be navigated using scrollbars, mouse dragging, and mouse wheel scrolling.
-
These navigation options are configurable through Blockly's initialization options using the
move
property and its sub-properties:scrollbars
,drag
, andwheel
. -
Scrollbars can be individually enabled or disabled for horizontal and vertical scrolling, while dragging and wheel scrolling are enabled or disabled with boolean values.
Blockly's main workspace can be moved around using three different methods: the scrollbars, the mouse, or the mouse wheel.
The move settings are defined by an object that is part of Blockly's configuration options. Here is an example:
var workspace = Blockly.inject('blocklyDiv',
{move:{
scrollbars: {
horizontal: true,
vertical: true
},
drag: true,
wheel: false}
});
scrollbars
Determines if the workspace has vertical or horizontal scrollbars. Takes an
object where the horizontal
property determines if horizontal scrolling is
enabled and the vertical
property determines if vertical scrolling is enabled.
If a boolean is passed then it is equivalent to passing an object with both
horizontal
and vertical
properties set as that value. Defaults to true
(both horizontal and vertical scrolling enabled) if the workspace has
categories.
drag
Determines if the workspace can be dragged with the mouse. Always false
if
scrollbars
is false
(at least in options parsing). Defaults to true
if scrollbars
is true
.
wheel
Determines if the workspace can be scrolled with the mouse wheel. Always false
if scrollbars
is false
(at least in options parsing). Defaults to false
.