Skip to content

Commit

Permalink
Sortable: Moved change of helper position css. Fixed #5321 – Helper i…
Browse files Browse the repository at this point in the history
…n a bottom-positioned Sortable is positioned wrong on drag start.
  • Loading branch information
martinf55 authored and scottgonzalez committed May 7, 2012
1 parent a0c734b commit 32f356b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/jquery.ui.sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,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,
Expand All @@ -168,6 +163,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;
Expand Down

0 comments on commit 32f356b

Please sign in to comment.