diff options
author | Robin <mail@robin-fowler.com> | 2016-09-23 12:40:36 +0100 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2016-10-04 11:05:01 -0400 |
commit | 1d409528a164c550e4e167c367f33ab3b7ad0e66 (patch) | |
tree | 999c2f8f926f1f6065ace4fd24a909dcccb752f7 | |
parent | fd30534b73eaf9c076f93a349dbe0c7a77efc209 (diff) | |
download | jquery-ui-1d409528a164c550e4e167c367f33ab3b7ad0e66.tar.gz jquery-ui-1d409528a164c550e4e167c367f33ab3b7ad0e66.zip |
Sortable: Fix parent offset detection
Fixes #15021
Closes gh-1749
-rw-r--r-- | ui/widgets/sortable.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/widgets/sortable.js b/ui/widgets/sortable.js index 8d2ada59a..f7298ebe5 100644 --- a/ui/widgets/sortable.js +++ b/ui/widgets/sortable.js @@ -224,18 +224,22 @@ return $.widget( "ui.sortable", $.ui.mouse, { left: event.pageX - this.offset.left, top: event.pageY - this.offset.top }, - parent: this._getParentOffset(), // This is a relative to absolute position minus the actual position calculation - // only used for relative positioned helper relative: this._getRelativeOffset() } ); - // Only after we got the offset, we can change the helper's position to absolute + // After we get the helper offset, but before we get the parent 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, { + parent: this._getParentOffset() + } ); + //Generate the original position this.originalPosition = this._generatePosition( event ); this.originalPageX = event.pageX; |