mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Sortable: Fixed container change detection. Fixes #5159 - Remove and receive events on nested sortables.
This commit is contained in:
parent
2b899cc843
commit
b9ef00f0c7
20
ui/jquery.ui.sortable.js
vendored
20
ui/jquery.ui.sortable.js
vendored
@ -1008,15 +1008,17 @@ $.widget("ui.sortable", $.ui.mouse, {
|
|||||||
|
|
||||||
if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
|
if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
|
||||||
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
|
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
|
||||||
if(!$.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
|
|
||||||
if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
|
// Check if the items Container has Changed and trigger appropriate
|
||||||
for (var i = this.containers.length - 1; i >= 0; i--){
|
// events.
|
||||||
if($.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
|
if (this !== this.currentContainer) {
|
||||||
delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
if(!noPropagation) {
|
||||||
delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
|
delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
|
||||||
}
|
delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
|
||||||
};
|
delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Post events to containers
|
//Post events to containers
|
||||||
for (var i = this.containers.length - 1; i >= 0; i--){
|
for (var i = this.containers.length - 1; i >= 0; i--){
|
||||||
|
Loading…
Reference in New Issue
Block a user