diff options
author | Eduardo Lundgren <eduardolundgren@gmail.com> | 2008-07-10 17:09:41 +0000 |
---|---|---|
committer | Eduardo Lundgren <eduardolundgren@gmail.com> | 2008-07-10 17:09:41 +0000 |
commit | 45bb23e02be52208b5e6cb35416aba8a9b07b14a (patch) | |
tree | 36434a077dd360e36bb9deae145e4598b3c334c3 | |
parent | 979e64bdd20afd4fd096c5fe089d3aa6e3c89880 (diff) | |
download | jquery-ui-45bb23e02be52208b5e6cb35416aba8a9b07b14a.tar.gz jquery-ui-45bb23e02be52208b5e6cb35416aba8a9b07b14a.zip |
Sortable updateOriginalPosition added
-rw-r--r-- | ui/ui.sortable.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index a64aa5648..b1b29cba2 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -123,7 +123,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { if ((x1 + dxClick) > l + item.width/2 && (x1 + dxClick) < r) return 1; } else { var height = item.height, helperHeight = this.helperProportions.height; - var direction = y1 - this.originalPosition.top < 0 ? 2 : 1; // 2 = up + var direction = y1 - this.updateOriginalPosition.top < 0 ? 2 : 1; // 2 = up if (direction == 1 && (y1 + dyClick) < t + height/2) { return 2; } // up else if (direction == 2 && (y1 + dyClick) > t + height/2) { return 1; } // down @@ -377,7 +377,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { left: po.left + this.offsetParentBorders.left }; - this.originalPosition = this.generatePosition(e); //Generate the original position + this.updateOriginalPosition = this.originalPosition = this.generatePosition(e); //Generate the original 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 @@ -532,6 +532,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, { && (this.options.type == 'semi-dynamic' ? !contains(this.element[0], this.items[i].item[0]) : true) ) { + this.updateOriginalPosition = this.generatePosition(e); + this.direction = intersection == 1 ? "down" : "up"; this.options.sortIndicator.call(this, e, this.items[i]); this.propagate("change", e); //Call plugins and callbacks |