Search and Top Navigation
#3067 closed bug (fixed)
Opened July 04, 2008 02:38PM UTC
Closed January 16, 2009 05:30AM UTC
Resizeable and containment works incorrectly
Reported by: | tjerkw@gmail.com | Owned by: | eduardo |
---|---|---|---|
Priority: | major | Milestone: | 1.7 |
Component: | ui.resizable | Version: | 1.5.1 |
Keywords: | containment out of bounds | Cc: | |
Blocked by: | Blocking: |
Description
When using the resizable ui behaviour like this:
var options={ containmentFix:this.getDayNode(), handles:"n,s", start:onchange, resize:onchange, stop:onchange }; this.node.resizable(options);
(where getDayNode and onchange are specified).
Then the resizeable will resize out of the containment element if there are enough other elements above the contianment elements.
I craeted my own fix, but i dont think this fix is the correct fix for everyone.
I craeted my own containmentFix plugin add like this:
$.ui.plugin.add("resizable", "containmentFix", {
Where all checks for (co.helper ? A : B) where simplified to A.
For example the resize method has the following code:
if (cp.top < (co.top)) { self.size.height = self.size.height + (self.position.top - co.top); if (pRatio) self.size.width = self.size.height / o.aspectRatio; self.position.top = co.top; }
The current code base is like this:
if (cp.top < (o.helper ? co.top : 0)) { self.size.height = self.size.height + (o.helper ? (self.position.top - co.top) : self.position.top); if (pRatio) self.size.width = self.size.height / o.aspectRatio; self.position.top = o.helper ? co.top : 0; }
Hope this gives you enough information to fix this bug.
Or maybe i must specify a helper in my options?
I dont know, this was at least awkward enough to file this bug.