Skip to content

Commit ace43f3

Browse files
committed
Pass former-container to onDrop if cancelled.
1 parent 438ce3d commit ace43f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/js/jquery-sortable.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,13 @@
290290

291291
if(this.dragging){
292292
// processing Drop, check if placeholder is detached
293-
if(this.placeholder.closest("html")[0])
293+
if(this.placeholder.closest("html")[0]){
294294
this.placeholder.before(this.item).detach()
295-
else
295+
this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e)
296+
} else {
296297
this.options.onCancel(this.item, this.itemContainer, groupDefaults.onCancel, e)
297-
298-
this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e)
298+
this.options.onDrop(this.item, this.itemContainer, groupDefaults.onDrop, e)
299+
}
299300

300301
// cleanup
301302
this.clearDimensions()

0 commit comments

Comments
 (0)