Skip to content

Commit 47cd5b6

Browse files
committed
Resizable: Fixed containment within relative/absolute positioned parent. Fixes #3882 - Left Margin Calculated Incorrectly (Using Containment). Patch provided by Brad Dunbar.
1 parent dcbd427 commit 47cd5b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ui/ui.resizable.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,11 @@ $.ui.plugin.add("resizable", "containment", {
690690
var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
691691
hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
692692

693+
var isParent = self.containerElement.get(0) == self.element.parent().get(0),
694+
isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
695+
696+
if(isParent && isOffsetRelative) woset -= self.parentData.left;
697+
693698
if (woset + self.size.width >= self.parentData.width) {
694699
self.size.width = self.parentData.width - woset;
695700
if (pRatio) self.size.height = self.size.width / o.aspectRatio;

0 commit comments

Comments
 (0)