diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-26 10:22:11 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-06-26 10:22:11 +0000 |
commit | 505d88ec285824b6ba0a27b597e5cd1094c67b40 (patch) | |
tree | d5636a11f225712d01fa06c86ea8ff760036ff8d /ui | |
parent | 0f0fb77a9e4f71ce1e12567ca7b99e31fada7018 (diff) | |
download | jquery-ui-505d88ec285824b6ba0a27b597e5cd1094c67b40.tar.gz jquery-ui-505d88ec285824b6ba0a27b597e5cd1094c67b40.zip |
sortable: update callback wass not called everytime (fixes #3028)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.sortable.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 87eda5c06..0120a9b30 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -369,7 +369,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, { }; this.originalPosition = this.generatePosition(e); //Generate the original position - this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position + this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; //Cache the former DOM position //If o.placeholder is used, create a new element at the given position with the class this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size @@ -578,9 +578,8 @@ $.widget("ui.sortable", $.extend($.ui.mouse, { }, clear: function(e, noPropagation) { - if(this.domPosition != this.currentItem.prev().not(".ui-sortable-helper")[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback if the DOM position has changed + if(this.domPosition[0] != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition[1] != this.currentItem.parent()[0]) this.propagate("update", e, null, noPropagation); //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(this.domPosition == this.currentItem.prev().not(".ui-sortable-helper")[0]) this.propagate("update", e, null, noPropagation); //Trigger update callback, if it wasn't triggered before, because that is definitely an update this.propagate("remove", e, null, noPropagation); for (var i = this.containers.length - 1; i >= 0; i--){ if(contains(this.containers[i].element[0], this.currentItem[0])) { |