From 065e0e7dc06712f3ef4796e86682702c71daa737 Mon Sep 17 00:00:00 2001 From: David Masover Date: Wed, 26 Sep 2012 15:34:45 -0500 Subject: [PATCH] Trigger sortupdate when dragging to the same index in another list. --- jquery.sortable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.sortable.js b/jquery.sortable.js index 350d172..2370d8f 100644 --- a/jquery.sortable.js +++ b/jquery.sortable.js @@ -22,6 +22,7 @@ $.fn.sortable = function(options) { return; } var isHandle, index, items = $(this).children(options.items); + var parent = $(this); var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">'); items.find(options.handle).mousedown(function() { isHandle = true; @@ -48,7 +49,7 @@ $.fn.sortable = function(options) { } dragging.removeClass('sortable-dragging').show(); placeholders.detach(); - if (index != dragging.index()) { + if (index != dragging.index() || (!dragging.parent().is(parent))) { dragging.parent().trigger('sortupdate', {item: dragging}); } dragging = null;