Skip to content
Permalink
Browse files
Sortable: Fix parent offset detection
Fixes #15021
Closes gh-1749
  • Loading branch information
typytype authored and scottgonzalez committed Oct 4, 2016
1 parent fd30534 commit 1d409528a164c550e4e167c367f33ab3b7ad0e66
Showing with 6 additions and 2 deletions.
  1. +6 −2 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;

0 comments on commit 1d40952

Please sign in to comment.