Skip to content
Permalink
Browse files

Resizable: Fixed containment within relative/absolute positioned pare…

…nt. Fixes #3882 - Left Margin Calculated Incorrectly (Using Containment). Patch provided by Brad Dunbar.
  • Loading branch information...
scottgonzalez committed Feb 19, 2009
1 parent dcbd427 commit 47cd5b6fca9ea36eee04165b7bf07448d5f34b27
Showing with 5 additions and 0 deletions.
  1. +5 −0 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;

0 comments on commit 47cd5b6

Please sign in to comment.
You can’t perform that action at this time.