r1034 - trunk/ui

r1034 - trunk/ui


Author: paul.bakaus
Date: Tue Dec 2 04:47:53 2008
New Revision: 1034
Modified:
trunk/ui/ui.sortable.js
Log:
sortable: fixed regression that caused wrong offset calculation if the
helper option has been set to "original"
Modified: trunk/ui/ui.sortable.js
==============================================================================
--- trunk/ui/ui.sortable.js    (original)
+++ trunk/ui/ui.sortable.js    Tue Dec 2 04:47:53 2008
@@ -99,9 +99,8 @@
        //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 @@
            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
@@ -635,9 +639,6 @@
        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;