Class: ScrollOptions
Defined in: plugins/scroll-options/src/index.ts:30
A Blockly plugin that adds additional features related to scrolling and dragging on workspaces. This plugin adds the ability to: a) use the mousewheel to scroll the workspace while a block is being dragged, and b) scroll the workspace automatically when a block is dragged near the edge.
All behavior is customizable. See the README for more information.
Properties index
| Property | Description |
|---|---|
| wheelEvent_ | Bound event listener for the scroll wheel event. |
| workspace_ | - |
Methods index
| Method | Description |
|---|---|
| disableEdgeScroll | Disables scrolling when block is dragged near edge. |
| disableWheelScroll | Disables scrolling with mousewheel during block drag. |
| enableEdgeScroll | Enables scrolling when block is dragged near edge. |
| enableWheelScroll | Enables scrolling with mousewheel during block drag. |
| init | Initialize plugin with optional options. If no options are provided, both plugin features are enabled with default settings. The plugin is configured here as a convenience. See the README for more information on configuring the plugin after initialization. |
| onMouseWheel_ | Scrolls the workspace with the mousewheel while a block is being dragged. Translates the currently dragged block as the user scrolls the workspace, so that the block does not appear to move. |
| updateEdgeScrollOptions | Updates edge scroll options. See ScrollBlockDragger for specific settings. Any values left unspecified will not be overwritten and will retain their previous values. |
Constructors
Constructor
new ScrollOptions(workspace): ScrollOptions;
Defined in: plugins/scroll-options/src/index.ts:42
Constructor for ScrollOptions plugin.
Parameters
| Parameter | Type | Description |
|---|---|---|
workspace | WorkspaceSvg | The workspace that the plugin will be added to. |
Returns
ScrollOptions
Properties
wheelEvent_
protected wheelEvent_: Data | null = null;
Defined in: plugins/scroll-options/src/index.ts:34
Bound event listener for the scroll wheel event.
workspace_
protected workspace_: WorkspaceSvg;
Defined in: plugins/scroll-options/src/index.ts:31
Methods
disableEdgeScroll()
disableEdgeScroll(): void;
Defined in: plugins/scroll-options/src/index.ts:146
Disables scrolling when block is dragged near edge.
Returns
void
disableWheelScroll()
disableWheelScroll(): void;
Defined in: plugins/scroll-options/src/index.ts:127
Disables scrolling with mousewheel during block drag.
Returns
void
enableEdgeScroll()
enableEdgeScroll(): void;
Defined in: plugins/scroll-options/src/index.ts:139
Enables scrolling when block is dragged near edge.
Returns
void
enableWheelScroll()
enableWheelScroll(): void;
Defined in: plugins/scroll-options/src/index.ts:98
Enables scrolling with mousewheel during block drag.
Returns
void
init()
init(root0?): void;
Defined in: plugins/scroll-options/src/index.ts:65
Initialize plugin with optional options. If no options are provided, both plugin features are enabled with default settings. The plugin is configured here as a convenience. See the README for more information on configuring the plugin after initialization.
Parameters
| Parameter | Type |
|---|---|
root0? | | { edgeScrollOptions?: Partial<EdgeScrollOptions>; enableEdgeScroll?: boolean; enableWheelScroll?: boolean; } | undefined |
Returns
void
onMouseWheel_()
onMouseWheel_(e): void;
Defined in: plugins/scroll-options/src/index.ts:168
Scrolls the workspace with the mousewheel while a block is being dragged. Translates the currently dragged block as the user scrolls the workspace, so that the block does not appear to move.
Parameters
| Parameter | Type | Description |
|---|---|---|
e | WheelEvent | Mouse wheel event. |
Returns
void
updateEdgeScrollOptions()
updateEdgeScrollOptions(options): void;
Defined in: plugins/scroll-options/src/index.ts:157
Updates edge scroll options. See ScrollBlockDragger for specific settings. Any values left unspecified will not be overwritten and will retain their previous values.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | Partial<EdgeScrollOptions> | Edge scroll options. |
Returns
void