From b9a51d5be80241249c61238991b1e7f88244468f Mon Sep 17 00:00:00 2001 From: kurtdavis Date: Thu, 27 Jan 2011 13:55:23 -0800 Subject: [PATCH] Fixed container offset where container is a block element within an 'absolute' positioned element. --- ui/jquery.ui.resizable.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index 38d543d2072..28792d921ac 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -677,8 +677,11 @@ $.ui.plugin.add("resizable", "containment", { self.containerPosition = element.position(); self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) }; - var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width, - width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); + var co = self.containerOffset, + ch = co.top + self.containerSize.height, + cw = co.left + self.containerSize.width, + width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), + height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch); self.parentData = { element: ce, left: co.left, top: co.top, width: width, height: height