Module: UWA/Controls/ThemedScroller

UWA/Controls/ThemedScroller

Index

Methods

<inner> build()

Initialize the wrapper, bind the events

<inner> getInnerElement() → {DOMElement}

Get the inner element. Use this if you want to access the content of the scroller.

Returns

the inner element

Type
DOMElement

<inner> getScrollbar(dir, create) → {DOMElement|undefined}

Get the scrollbar for one direction. Optionally, the scrollbar is built if it does not exist yet.

Parameters
Name Type Argument Default Description
dir String

'x' or 'y'

create Boolean <optional>
false

create the scrollbar if it does not exist

Returns

the scrollbar element or undefined if it does not exist yet.

Type
DOMElement | undefined

<inner> getShadow(dir, create) → {DOMElement|undefined}

Get the shadow for one direction. Optionally, the shadow is built if it does not exist yet.

Parameters
Name Type Argument Default Description
dir String

'x-start', 'x-end', 'y-start' or 'y-end'

create Boolean <optional>
false

create the shadow if it does not exist

Returns

the shadow element or undefined if it does not exist yet.

Type
DOMElement | undefined

<inner> showShadow(dir, value)

Show or hide a shadow.

Parameters
Name Type Description
dir String

'x-start', 'x-end', 'y-start' or 'y-end'

value Number

number of pixels available to scroll. Used to change the intensity of the shadow.

<inner> updateActive(event)

Update the active scrollbars according to the current pointer position. This will call updateVisible in order to update the rendering.

Parameters
Name Type Description
event DOMEvent

the mouse or touch event to use to know the position of the pointer.

<inner> updateVisible()

Set the scrollbars visible for one second. This will call update in order to update the rendering.

<protected, inner> _read(y)

Access to the DOM to read the sizes needed for the _write method.

Parameters
Name Type Description
y Boolean

true if this is the 'y' direction

<protected, inner> _write(y)

Update the DOM according to the current scroller state (informations gathered by _write and other methods).

Parameters
Name Type Description
y Boolean

true if this is the 'y' direction

<inner> update()

Update the scroller rendering. This method is debounced using a requestAnimationFrame and won't change anything if the direction informations did not change since the last call.