ClickableRail Class
Slider extension that allows clicking on the Slider's rail element, triggering the thumb to align with the location of the click.
Index
Methods
Attributes
Events
Methods
_bindClickableRail
()
protected
Attaches DOM event subscribers to support rail interaction.
_defRailMouseDownFn
-
e
Default behavior for the railMouseDown event. Centers the thumb at the click location and passes control to the DDM to behave as though the thumb itself were clicked in preparation for a drag operation.
Parameters:
-
e
Eventthe EventFacade for the railMouseDown custom event
_getThumbDestination
-
e
-
node
Calculates the top left position the thumb should be moved to to align the click XY with the center of the specified node.
Parameters:
-
e
DOMEventThe mousedown event object
-
node
NodeThe node to position
Returns:
the [top, left] pixel position of the destination
_initClickableRail
()
protected
Initializes the internal state and sets up events.
_onRailMouseDown
-
e
Dispatches the railMouseDown event.
Parameters:
-
e
DOMEventthe mousedown event object
_resolveThumb
-
e
Resolves which thumb to actuate if any. Override this if you want to support multiple thumbs. By default, returns the Drag instance for the thumb stored by the Slider.
Parameters:
-
e
DOMEventthe mousedown event object
Returns:
the Drag instance that should be moved
_unbindClickableRail
()
protected
Detaches DOM event subscribers for cleanup/destruction cycle.
Events
railMouseDown
Broadcasts when the rail has received a mousedown event and triggers the thumb positioning. Use <code>e.preventDefault()</code> or <code>set("clickableRail", false)</code> to prevent the thumb positioning.