Permalink
Browse files

Draggable: append the iframe fixes to the offset parent of the iframe…

…s instead of body


This gives the user a measure of control over where the fixes are added - one simply
needs to specify "position: relative" on an ancestor of the iframe and the fix will be put
there. In this way, the iframe fixes can be a little bit more robust when changes to the
page happen which cause the iframes to change their offset on the page.

Things will still break if the iframe changes size or moves within its offset parent.
  • Loading branch information...
1 parent ce7918f commit 4e3f25d06531a9ec637d9bce3af2fd308ac8fbfd @atrigent committed Dec 1, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/jquery.ui.draggable.js
View
4 ui/jquery.ui.draggable.js
@@ -87,8 +87,8 @@ $.widget("ui.draggable", $.ui.mouse, {
width: this.offsetWidth+"px", height: this.offsetHeight+"px",
position: "absolute", opacity: "0.001", zIndex: 1000
})
- .css($(this).offset())
- .appendTo("body");
+ .css($(this).position())
+ .appendTo($(this).offsetParent());
});
return true;

0 comments on commit 4e3f25d

Please sign in to comment.