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.
Workspace to bind the scrollbar to.
True if horizontal, false if vertical.
Optionalopt_pair: booleanTrue if scrollbar is part of a horiz/vert pair.
Optionalopt_class: stringA class to be applied to this scrollbar.
Optionalopt_margin: numberThe margin to apply to this scrollbar.
The upper left corner of the scrollbar's SVG group in CSS pixels relative to the scrollbar's origin. This is usually relative to the injection div origin.
The ratio of handle position offset to workspace content displacement.
Is the scrollbar visible. Non-paired scrollbars disappear when they aren't needed.
True if visible.
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.
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 the scrollbar handle's position.
The content displacement, relative to the view in pixels.
OptionalupdateMetrics: booleanWhether to update metrics on this set call. Defaults to true.
Set whether the scrollbar's container is visible and update display accordingly if visibility has changed.
Whether the container is visible
Set the offset of the scrollbar's handle from the scrollbar's position, and change the SVG attribute accordingly.
The new scrollbar handle offset in CSS pixels.
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.)
The x coordinate of the scrollbar's origin, in CSS pixels.
The y coordinate of the scrollbar's origin, in CSS pixels.
Set whether the scrollbar is visible. Only applies to non-paired scrollbars.
True if visible.
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.
Fake class which should be extended to avoid inheriting static properties