]> source.dussan.org Git - jquery-ui.git/commitdiff
Draggable/Sortable: Partial fix for #4009: Fixed ui hash for sortable activate/deacti...
authorScott González <scott.gonzalez@gmail.com>
Thu, 5 Feb 2009 04:21:21 +0000 (04:21 +0000)
committerScott González <scott.gonzalez@gmail.com>
Thu, 5 Feb 2009 04:21:21 +0000 (04:21 +0000)
ui/ui.draggable.js

index 524554e233e367428fcbbfe83852d37665d58673..92dbc372dbc92fb4743146771ce3c65863b8825b 100644 (file)
@@ -436,7 +436,8 @@ $.extend($.ui.draggable, {
 $.ui.plugin.add("draggable", "connectToSortable", {
        start: function(event, ui) {
 
-               var inst = $(this).data("draggable"), o = inst.options;
+               var inst = $(this).data("draggable"), o = inst.options,
+                       uiSortable = $.extend({}, ui, { item: inst.element });
                inst.sortables = [];
                $(o.connectToSortable).each(function() {
                        var sortable = $.data(this, 'sortable');
@@ -446,7 +447,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
                                        shouldRevert: sortable.options.revert
                                });
                                sortable._refreshItems();       //Do a one-time refresh at start to refresh the containerCache
-                               sortable._trigger("activate", event, inst);
+                               sortable._trigger("activate", event, uiSortable);
                        }
                });
 
@@ -454,7 +455,8 @@ $.ui.plugin.add("draggable", "connectToSortable", {
        stop: function(event, ui) {
 
                //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
-               var inst = $(this).data("draggable");
+               var inst = $(this).data("draggable"),
+                       uiSortable = $.extend({}, ui, { item: inst.element });
 
                $.each(inst.sortables, function() {
                        if(this.instance.isOver) {
@@ -478,7 +480,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
 
                        } else {
                                this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
-                               this.instance._trigger("deactivate", event, inst);
+                               this.instance._trigger("deactivate", event, uiSortable);
                        }
 
                });