Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions addon/components/drag-sort-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default Component.extend({
sourceOnly : false,

dragEndAction : undefined,
dragStartAction : undefined,
determineForeignPositionAction : undefined,


Expand Down Expand Up @@ -162,6 +163,19 @@ export default Component.extend({
if (event.dataTransfer.setDragImage) event.dataTransfer.setDragImage(this.element, 0, 0)
}

const dragStartAction = this.get('dragStartAction')

if (dragStartAction) {
const element = this.get('element')
const item = this.get('item')

dragStartAction({
event,
element,
draggedItem : item,
})
}

this.startDragging(event)
},

Expand Down
1 change: 1 addition & 0 deletions addon/components/drag-sort-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default Component.extend({
isRtl : false,

dragEndAction : undefined,
dragStartAction : undefined,
determineForeignPositionAction : undefined,


Expand Down
1 change: 1 addition & 0 deletions addon/templates/components/drag-sort-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
isRtl = isRtl
draggingEnabled = draggingEnabled
dragEndAction = dragEndAction
dragStartAction = dragStartAction
determineForeignPositionAction = determineForeignPositionAction
sourceOnly = sourceOnly
}}
Expand Down