r2107 - trunk/ui

r2107 - trunk/ui


Author: scott.gonzalez
Date: Wed Feb 18 18:49:54 2009
New Revision: 2107
Modified:
trunk/ui/ui.resizable.js
Log:
Resizable: Fixed containment within relative/absolute positioned parent.
Fixes #3882 - Left Margin Calculated Incorrectly (Using Containment).
Patch provided by Brad Dunbar.
Modified: trunk/ui/ui.resizable.js
==============================================================================
--- trunk/ui/ui.resizable.js    (original)
+++ trunk/ui/ui.resizable.js    Wed Feb 18 18:49:54 2009
@@ -690,6 +690,11 @@
        var woset = Math.abs( (self._helper ? self.offset.left - cop.left :
(self.offset.left - cop.left)) + self.sizeDiff.width ),
                    hoset = Math.abs( (self._helper ? self.offset.top - cop.top :
(self.offset.top - co.top)) + self.sizeDiff.height );
+        var isParent = self.containerElement.get(0) ==
self.element.parent().get(0),
+         isOffsetRelative = /relative|
absolute/.test(self.containerElement.css('position'));
+
+        if(isParent && isOffsetRelative) woset -= self.parentData.left;
+
        if (woset + self.size.width >= self.parentData.width) {
            self.size.width = self.parentData.width - woset;
            if (pRatio) self.size.height = self.size.width / o.aspectRatio;