From ace43f3a7147d965527cb8155920619f683a3975 Mon Sep 17 00:00:00 2001 From: Jonny Gerig Meyer Date: Mon, 11 Aug 2014 18:32:21 -0400 Subject: [PATCH] Pass former-container to onDrop if cancelled. --- source/js/jquery-sortable.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/js/jquery-sortable.js b/source/js/jquery-sortable.js index 099a0d2..2d89427 100644 --- a/source/js/jquery-sortable.js +++ b/source/js/jquery-sortable.js @@ -290,12 +290,13 @@ if(this.dragging){ // processing Drop, check if placeholder is detached - if(this.placeholder.closest("html")[0]) + if(this.placeholder.closest("html")[0]){ this.placeholder.before(this.item).detach() - else + this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e) + } else { this.options.onCancel(this.item, this.itemContainer, groupDefaults.onCancel, e) - - this.options.onDrop(this.item, this.getContainer(this.item), groupDefaults.onDrop, e) + this.options.onDrop(this.item, this.itemContainer, groupDefaults.onDrop, e) + } // cleanup this.clearDimensions()