]> source.dussan.org Git - jquery-ui.git/commitdiff
Sortable: Moved change of helper position css. Fixed #5321 – Helper in a bottom-posit...
authormartinf55 <martinf55@hotmail.com>
Mon, 7 May 2012 10:28:47 +0000 (12:28 +0200)
committerScott González <scott.gonzalez@gmail.com>
Mon, 7 May 2012 13:05:07 +0000 (09:05 -0400)
(cherry picked from commit 32f356bbfa9a8f3b90b4e64331e9108b4d87a349)

ui/jquery.ui.sortable.js

index c1566fd58bfc167e7ce26765b28e7ac19825c7f3..57532aa0391d269fcfcd7eebf6c6f21b4eefd126 100644 (file)
@@ -155,11 +155,6 @@ $.widget("ui.sortable", $.ui.mouse, {
                        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
                                left: event.pageX - this.offset.left,
@@ -169,6 +164,11 @@ $.widget("ui.sortable", $.ui.mouse, {
                        relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
                });
 
+               // 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");
+               
                //Generate the original position
                this.originalPosition = this._generatePosition(event);
                this.originalPageX = event.pageX;