Default class to find the nearest target only if the mouse is over an area.
check if the dragNode is in the interval.
| Parameter | Type | Description |
|---|---|---|
| areaList | Array | a list of D&D areas objects |
| index | Integer | index of a D&D area (to get the interval) |
| x | Coord | coordinate x, of the dragNode (see getDragPoint()) |
| y | Coord |
true if the dragNode is in intervall
update the D&D area object (i.e. update coordinates of its DOM node)
| Parameter | Type | Description |
|---|---|---|
| area | Object | the D&D area. |
Add a D&D Area into an array sorting by the x position.
| Parameter | Type | Description |
|---|---|---|
| areas | Array | array of areas |
| object | Object | data type of a DndArea |
a sorted area
return coordinates of the draggable item.
| Parameter | Type | Description |
|---|---|---|
| coords | Object | an object encapsulating X and Y position |
| size | Object | an object encapsulating width and height values |
| mousePosition | Object | coordinates of mouse |
an object of coordinates examples:{'x':10,'y':10}
Return the index where the drop has to be placed.
| Parameter | Type | Description |
|---|---|---|
| targetArea | Object | a D&D area object. |
| coords | Object | coordinates [x,y] of the draggable item. |
a number or -1 if the area has no children or the drop index represents the last position in to the area
get the nearest D&D area.
| Parameter | Type | Description |
|---|---|---|
| areaList | Array | a list of D&D areas objects |
| coords | Object | coordinates [x,y] of the dragItem (see getDragPoint()) |
| currentIndexArea | integer | an index representing the active D&D area |
the index of the D&D area
initialize the horizontal line in order to determinate the drop zone.
| Parameter | Type | Description |
|---|---|---|
| area | Object | the D&D area. |
take into account the drop indicator DOM element in order to compute horizontal lines
| Parameter | Type | Description |
|---|---|---|
| area | Object | a D&D area object |
| indexItem | Integer | index of a draggable item |
| size | Object | dropIndicator size |
| added | Boolean | boolean to know if a dropIndicator has been added or deleted |
refresh areas position and size to determinate the nearest area to drop an item
the area position (and size) is equal to the postion of the domNode associated.
| Parameter | Type | Description |
|---|---|---|
| areaList | Array | array of areas |