blockly > ScrollbarPair

ScrollbarPair class

Class for a pair of scrollbars. Horizontal and vertical.

Signature:

export declare class ScrollbarPair 

Constructors

Constructor Modifiers Description
(constructor)(workspace, addHorizontal, addVertical, opt_class, opt_margin) Constructs a new instance of the ScrollbarPair class

Properties

Property Modifiers Type Description
corner_ SVGRectElement | null
hScroll Scrollbar | null
vScroll Scrollbar | null

Methods

Method Modifiers Description
canScrollHorizontally() Returns whether scrolling horizontally is enabled.
canScrollVertically() Returns whether scrolling vertically is enabled.
dispose() Dispose of this pair of scrollbars. Unlink from all DOM elements to prevent memory leaks.
isVisible() If any of the scrollbars are visible. Non-paired scrollbars may disappear when they aren't needed.
resize() Recalculate both of the scrollbars' locations and lengths. Also reposition the corner rectangle.
resizeContent(hostMetrics) Recalculates the scrollbars' locations within their path and length. This should be called when the contents of the workspace have changed.
resizeView(hostMetrics) Recalculates the scrollbars' locations on the screen and path length. This should be called when the layout or size of the window has changed.
set(x, y, updateMetrics) Set the handles of both scrollbars.
setContainerVisible(visible) Set whether this scrollbar's container is visible.
setVisible(visible) Sets the visibility of any existing scrollbars.
setX(x) Set the handle of the horizontal scrollbar to be at a certain position in CSS pixels relative to its parents.
setY(y) Set the handle of the vertical scrollbar to be at a certain position in CSS pixels relative to its parents.