Ticket #4303: sortable-item-sender.patch

File sortable-item-sender.patch, 1.3 KB (added by asannes, 13 years ago)

Make sure item is the item being added and sender is still the sender

  • (a) 1.7.2/ui.sortable.js vs. (b) fixed/ui.sortable.js.fixed

    a b  
    909909                        this.currentItem.show();
    910910                }
    911911
    912                 if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
     912                if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this)); });
    913913                if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
    914914                if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
    915915                        if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
     
    977977                        absolutePosition: self.positionAbs, //deprecated
    978978                        offset: self.positionAbs,
    979979                        item: self.currentItem,
    980                         sender: inst ? inst.element : null
     980                        sender: self.fromOutside ? self.fromOutside.element : null
    981981                };
    982982        }
    983983