blockly > Scrollbar
Class for a pure SVG scrollbar. This technique offers a scrollbar that is guaranteed to work, but may not look or behave like the system's scrollbars.
Signature:
export declare class Scrollbar
Constructors
Properties
Methods
Method |
Modifiers |
Description |
dispose() |
|
Dispose of this scrollbar. Remove DOM elements, event listeners, and theme subscriptions. |
isVisible() |
|
Is the scrollbar visible. Non-paired scrollbars disappear when they aren't needed. |
resize(opt_metrics) |
|
Recalculate the scrollbar's location and its length. |
resizeContentHorizontal(hostMetrics) |
|
Recalculate a horizontal scrollbar's location within its path and length. This should be called when the contents of the workspace have changed. |
resizeContentVertical(hostMetrics) |
|
Recalculate a vertical scrollbar's location within its path and length. This should be called when the contents of the workspace have changed. |
resizeViewHorizontal(hostMetrics) |
|
Recalculate a horizontal scrollbar's location on the screen and path length. This should be called when the layout or size of the window has changed. |
resizeViewVertical(hostMetrics) |
|
Recalculate a vertical scrollbar's location on the screen and path length. This should be called when the layout or size of the window has changed. |
set(value, updateMetrics) |
|
Set the scrollbar handle's position. |
setContainerVisible(visible) |
|
Set whether the scrollbar's container is visible and update display accordingly if visibility has changed. |
setHandlePosition(newPosition) |
|
Set the offset of the scrollbar's handle from the scrollbar's position, and change the SVG attribute accordingly. |
setOrigin(x, y) |
|
Record the origin of the workspace that the scrollbar is in, in pixels relative to the injection div origin. This is for times when the scrollbar is used in an object whose origin isn't the same as the main workspace (e.g. in a flyout.) |
setVisible(visible) |
|
Set whether the scrollbar is visible. Only applies to non-paired scrollbars. |
updateDisplay_() |
|
Update visibility of scrollbar based on whether it thinks it should be visible and whether its containing workspace is visible. We cannot rely on the containing workspace being hidden to hide us because it is not necessarily our parent in the DOM. |