diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-02-19 02:49:54 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-02-19 02:49:54 +0000 |
commit | 47cd5b6fca9ea36eee04165b7bf07448d5f34b27 (patch) | |
tree | 8e6c795b3f8272d9ed833c506d26ef027a0b1b63 | |
parent | dcbd427cdf20dfcf847d9daa22b591fac6893330 (diff) | |
download | jquery-ui-47cd5b6fca9ea36eee04165b7bf07448d5f34b27.tar.gz jquery-ui-47cd5b6fca9ea36eee04165b7bf07448d5f34b27.zip |
Resizable: Fixed containment within relative/absolute positioned parent. Fixes #3882 - Left Margin Calculated Incorrectly (Using Containment). Patch provided by Brad Dunbar.
-rw-r--r-- | ui/ui.resizable.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/ui.resizable.js b/ui/ui.resizable.js index bfa04ede2..114aab830 100644 --- a/ui/ui.resizable.js +++ b/ui/ui.resizable.js @@ -690,6 +690,11 @@ $.ui.plugin.add("resizable", "containment", { 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; |