Methods
cardDrag(event)
Handle card drag operation Processes drag movement without dropping
| Name | Type | Description |
|---|---|---|
event | DragEvent | Drag event from card element |
connect()
Connect controller to DOM Sets up global drag and drop event listeners
disconnect()
Disconnect controller from DOM Cleans up global event listeners
dropCard(event)
Handle card drop operation Processes final drop with server synchronization
| Name | Type | Description |
|---|---|---|
event | DragEvent | Drop event from target element |
grabCard(event)
Handle card grab (drag start) Sets up drag operation and records original position
| Name | Type | Description |
|---|---|---|
event | DragEvent | Dragstart event from card element |
handleDragOver(event)
Handle global drag over events Prevents default behavior to enable drop
| Name | Type | Description |
|---|---|---|
event | DragEvent | Global dragover event |
handleDrop(event)
Handle global drop events Restores original position if dropped outside valid area
| Name | Type | Description |
|---|---|---|
event | DragEvent | Global drop event |
initialize()
Initialize controller state Sets up drag tracking variables
processDrag(event, isDrop)
Process drag operation with position calculation and server sync Handles both preview and final drop operations
| Name | Type | Description |
|---|---|---|
event | DragEvent | Drag or drop event |
isDrop | Boolean | Whether this is final drop operation |
registerBeforeDrop(callback)
Register callback function to validate drops before processing Allows custom validation logic for card movements
| Name | Type | Description |
|---|---|---|
callback | function | Validation function returning boolean |
restoreOriginalPosition()
Restore card to its original position Used when drop is invalid or cancelled