r1676 - trunk/ui

r1676 - trunk/ui


Author: paul.bakaus
Date: Mon Jan 19 03:34:22 2009
New Revision: 1676
Modified:
trunk/ui/ui.draggable.js
trunk/ui/ui.sortable.js
Log:
draggable,sortable: if connectToSortable is used, ui.sender has to be the
original draggable (fixes #3856)
Modified: trunk/ui/ui.draggable.js
==============================================================================
--- trunk/ui/ui.draggable.js    (original)
+++ trunk/ui/ui.draggable.js    Mon Jan 19 03:34:22 2009
@@ -466,10 +466,7 @@
                
                //Trigger the stop of the sortable
                this.instance._mouseStop(event);
-
-                //Also propagate receive event, since the sortable is actually
receiving a element
-                this.instance.element.triggerHandler("sortreceive", [event,
$.extend(this.instance._uiHash(), { sender: inst.element })],
this.instance.options["receive"]);
-
+                
                this.instance.options.helper = this.instance.options._helper;
                //If the helper has been the original item, restore properties in the
sortable
@@ -523,7 +520,7 @@
                    inst._trigger("toSortable", event);
                    inst.dropped = this.instance.element; //draggable revert needs that
-                    this.instance.fromOutside = true; //Little hack so receive/update
callbacks work
+                    this.instance.fromOutside = inst; //Little hack so receive/update
callbacks work
                }
Modified: trunk/ui/ui.sortable.js
==============================================================================
--- trunk/ui/ui.sortable.js    (original)
+++ trunk/ui/ui.sortable.js    Mon Jan 19 03:34:22 2009
@@ -902,7 +902,7 @@
            this.currentItem.show();
        }
-        if(this.fromOutside && !noPropagation) this._trigger("receive", event,
this._uiHash(this));
+        if(this.fromOutside && !noPropagation) this._trigger("receive", event,
this._uiHash(this.fromOutside));
        if((this.fromOutside || this.domPosition.prev !=
this.currentItem.prev().not("."+this.options.cssNamespace+"-sortable-helper")[0]
|| this.domPosition.parent != this.currentItem.parent()[0])
&& !noPropagation) this._trigger("update", event, this._uiHash());
//Trigger update callback if the DOM position has changed
        if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was
moved out of the current element
            if(!noPropagation) this._trigger("remove", event, this._uiHash());