Class TouchListItemEL

Touchstart, touchmove, touchend and touchcancel on an list item event listener

Source : file controls/sortableListControl/TouchListItemEL.js at line 33

Constructor

new TouchListItemEL ( dropFunction )

The constructor

Source : file controls/sortableListControl/TouchListItemEL.js at line 418

Parameters

Name Type Description
dropFunction Function

The function to call when an item is droped

Public methods

handleEvent ( touchEvent )

Event listener method

Source : file controls/sortableListControl/TouchListItemEL.js at line 431

Parameters

Name Type Description
touchEvent Event

The event to handle

Private properties

#bottomScrollPosition : Number

The Y position in pixels where the bottom scroll will start

Source : file controls/sortableListControl/TouchListItemEL.js at line 96

#clonedListItemHTMLElement : HTMLElement

A clone of the html element selected for dragging

Source : file controls/sortableListControl/TouchListItemEL.js at line 68

#deltaMoveX : Number

The X distance betwwen the touch point and the top left corner of the moved item

Source : file controls/sortableListControl/TouchListItemEL.js at line 124

#deltaMoveY : Number

The Y distance betwwen the touch point and the top left corner of the moved item

Source : file controls/sortableListControl/TouchListItemEL.js at line 131

#dropFunction : Function

The function to call when an item is droped

Source : file controls/sortableListControl/TouchListItemEL.js at line 40

#dropOnTop : Boolean

A boolean - true when the drop point is on top of the target and false when at bottom

Source : file controls/sortableListControl/TouchListItemEL.js at line 117

#dropTargetHTMLElement : HTMLElement

The drop target

Source : file controls/sortableListControl/TouchListItemEL.js at line 110

#isDoubleClick : Boolean

A boolean to store if the event was generated with a double click or not

Source : file controls/sortableListControl/TouchListItemEL.js at line 47

#lastScrollTimeStamp : Number

The timestamp of the last scroll action

Source : file controls/sortableListControl/TouchListItemEL.js at line 61

#lastTouchStartTimeStamp : Number

The timestamp of the last touchstart event

Source : file controls/sortableListControl/TouchListItemEL.js at line 54

#scrolledContainerHTMLElement : HTMLElement

The container with the scroll bars

Source : file controls/sortableListControl/TouchListItemEL.js at line 82

#sortableListHTMLElement : HTMLElement

The container of the displayed list

Source : file controls/sortableListControl/TouchListItemEL.js at line 75

#topScrollPosition : Number

The Y position in pixels where the top scroll will start

Source : file controls/sortableListControl/TouchListItemEL.js at line 89

#touchY : Number

The Y position in pixels of the current touch event

Source : file controls/sortableListControl/TouchListItemEL.js at line 103

Private getters and setters

readonly static get #BOTTOM_SCROLL_DISTANCE : Number

A constant giving the distance in pixel betwwen the bottom of the container and the place where the scroll will start

Source : file controls/sortableListControl/TouchListItemEL.js at line 174

readonly static get #DBL_CLICK_MAX_DELAY : Number

A constant giving the max delay in ms between 2 clicks to consider it's a double click

Source : file controls/sortableListControl/TouchListItemEL.js at line 139

readonly static get #SCROLL_DELAY : Number

A constant giving the delay in ms betwwen two scroll actions for the requestAnimationFrame ( ) method See also https://developer.mozilla.org/fr/docs/Web/API/Document/scroll_event

Source : file controls/sortableListControl/TouchListItemEL.js at line 148

readonly static get #SCROLL_VALUE : Number

A constant giving the number of pixels to scroll

Source : file controls/sortableListControl/TouchListItemEL.js at line 156

readonly static get #TOP_SCROLL_DISTANCE : Number

A constant giving the distance in pixel betwwen the top of the container and the place where the scroll will start

Source : file controls/sortableListControl/TouchListItemEL.js at line 165

Private methods

#handleEndEvent ( touchEvent )

Handle the touchend event

Source : file controls/sortableListControl/TouchListItemEL.js at line 370

Parameters

Name Type Description
touchEvent Event

The event to handle

#handleMoveEvent ( touchEvent )

Handle the touchmove event

Source : file controls/sortableListControl/TouchListItemEL.js at line 288

Parameters

Name Type Description
touchEvent Event

The event to handle

#handleStartEvent ( touchEvent )

Handle the touchstart event

Source : file controls/sortableListControl/TouchListItemEL.js at line 237

Parameters

Name Type Description
touchEvent Event

The event to handle

#reset ( )

Reset some variables after a touchend or touchcancel event

Source : file controls/sortableListControl/TouchListItemEL.js at line 397

#scrollContainerToBottom ( scrollTimeStamp )

Scroll the list container to the bottom

Source : file controls/sortableListControl/TouchListItemEL.js at line 206

Parameters

Name Type Description
scrollTimeStamp Number

The time stamp of the call to the method. See window.requestAnimationFrame ( )

#scrollContainerToTop ( scrollTimeStamp )

Scroll the list container to the top

Source : file controls/sortableListControl/TouchListItemEL.js at line 181

Parameters

Name Type Description
scrollTimeStamp Number

The time stamp of the call to the method. See window.requestAnimationFrame ( )

#setDropTargetAndPosition ( touch )

Set the drop target and the drop position from the touch of the dragend event

Source : file controls/sortableListControl/TouchListItemEL.js at line 337

Parameters

Name Type Description
touch Touch

The dragend event touch