Skip to main content

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​

PropertyDescription
wheelEvent_Bound event listener for the scroll wheel event.
workspace_-

Methods index​

MethodDescription
disableEdgeScrollDisables scrolling when block is dragged near edge.
disableWheelScrollDisables scrolling with mousewheel during block drag.
enableEdgeScrollEnables scrolling when block is dragged near edge.
enableWheelScrollEnables scrolling with mousewheel during block drag.
initInitialize 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.
updateEdgeScrollOptionsUpdates 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​

ParameterTypeDescription
workspaceWorkspaceSvgThe 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​

ParameterType
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​

ParameterTypeDescription
eWheelEventMouse 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​

ParameterTypeDescription
optionsPartial<EdgeScrollOptions>Edge scroll options.

Returns​

void