aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-12-02 12:47:53 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-12-02 12:47:53 +0000
commit6c93b4e2f0053967dee543e7f9c89623d4864ff3 (patch)
treeead05effd02219395352596f4c7a4e619eb4fc6a /ui
parent152531d37059895a06cb7f86b7249cce481f9370 (diff)
downloadjquery-ui-6c93b4e2f0053967dee543e7f9c89623d4864ff3.tar.gz
jquery-ui-6c93b4e2f0053967dee543e7f9c89623d4864ff3.zip
sortable: fixed regression that caused wrong offset calculation if the helper option has been set to "original"
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.sortable.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 2e8992807..d972d7c7a 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -99,9 +99,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
//Cache the margins of the original element
this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
+
+ //Get the next scrolling parent
this.scrollParent = this.helper.scrollParent();
//The element's absolute position on the page minus margins
@@ -110,6 +109,11 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
};
+
+ // Only after we got the offset, we can change the helper's position to absolute
+ // TODO: Still need to figure out a way to make relative sorting possible
+ this.helper.css("position", "absolute");
+ this.cssPosition = this.helper.css("position");
$.extend(this.offset, {
click: { //Where the click happened, relative to the element
@@ -636,9 +640,6 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
- //TODO: Still need to figure out a way to make relative sorting possible
- helper.css("position", "absolute");
-
return helper;
},