diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2014-08-23 15:34:04 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-08-23 15:34:04 -0400 |
commit | df7e32fe3798562ffb86d064444f1e0cc8ac59a8 (patch) | |
tree | 67fe94208acb8210e369608071a33715adf7b714 /ui/draggable.js | |
parent | 95546c5d045f8055b121f24d3e35468e2a570c1b (diff) | |
download | jquery-ui-df7e32fe3798562ffb86d064444f1e0cc8ac59a8.tar.gz jquery-ui-df7e32fe3798562ffb86d064444f1e0cc8ac59a8.zip |
Draggable: Check all parents for fixed positioning when scrolling
Fixes #9612
Diffstat (limited to 'ui/draggable.js')
-rw-r--r-- | ui/draggable.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/draggable.js b/ui/draggable.js index 8cbcfe1ab..ebafaeb83 100644 --- a/ui/draggable.js +++ b/ui/draggable.js @@ -174,7 +174,9 @@ $.widget("ui.draggable", $.ui.mouse, { this.cssPosition = this.helper.css( "position" ); this.scrollParent = this.helper.scrollParent( true ); this.offsetParent = this.helper.offsetParent(); - this.offsetParentCssPosition = this.offsetParent.css( "position" ); + this.hasFixedAncestor = this.helper.parents().filter(function() { + return $( this ).css( "position" ) === "fixed"; + }).length > 0; //The element's absolute position on the page minus margins this.positionAbs = this.element.offset(); @@ -236,7 +238,7 @@ $.widget("ui.draggable", $.ui.mouse, { _mouseDrag: function(event, noPropagation) { // reset any necessary cached properties (see #5009) - if ( this.offsetParentCssPosition === "fixed" ) { + if ( this.hasFixedAncestor ) { this.offset.parent = this._getParentOffset(); } |