From 4e3f25d06531a9ec637d9bce3af2fd308ac8fbfd Mon Sep 17 00:00:00 2001 From: Ari Entlich Date: Thu, 1 Dec 2011 14:20:58 -0500 Subject: [PATCH] Draggable: append the iframe fixes to the offset parent of the iframes 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. --- ui/jquery.ui.draggable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 92dd13c0d41..bd99f2f72c3 100644 --- a/ui/jquery.ui.draggable.js +++ b/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;