Resizable updates - patch file

Resizable updates - patch file


Team,
Like the Selectable patch file I posted recently, here is a Resizable
patch file.
http://codesquare.com/js/ui.resizable.patch.js
Here is what it does:
x. It adds better support for resize in the north, northeast,
northwest, west, and southwest directions. The previous released
version didn't have those handles enabled by default, and when we
enabled them we discovered that resizing in those directions didn't
change the top/left coordinates. The result was that resizing in the
north direction would actually resize the div in the south direction.
So we added code to handle repositioning as well as size scaling for
those resize directions.
x. We added a setResizeArray().
Example Usage:
$('.ui-resizable').setResizeArray($('.ui-resizable').get(),
canvasBox);
This would make all other resizables proportionally resized as well.
- It adds the ability to enforce different containment coordinates
on each element in the modifyThese (proportionallyResize) array.
- I chose not to use the proportionallyResize option and injected
elements directly into the internal modifyThese array since
proportionallyResize only allows you to modify children of the
Resizable.
Note: We have a use case where there is a group of selected resizables
that when one resizable is resized all the others get resized as
well. The problem was that only the resizable being resized would
respect the parent containment. Therefore, we added support for
containment for all elements that end up in the modifyThese array.
Notes/warnings:
x. We are probably making assumptions about absolute positioning so if
anyone wants to add checks for relative positioning feel free, and
I'll include them before formally submitting these changes to the
jquery ui team for inclusion in the next release. I try to use true
absolute coords (via offset()) whenever possible to avoid problems
with css absolute/relative/fixed/static positioning but I'm sure I
missed a few things in there.
x. I was also attempting to add an 'allow' option which would let you
control which style attributes were getting touched by the group
resize (i.e. allow => {top:true,left:true,width:true,height:true}). I
decided against it for the moment and commented most of that stuff
out. I'll remove it on my next refactor pass.