#4217 closed bug (fixed)
Resizable: displacement of element (in case of constraint resize area) - BUG FIX supplied !
Reported by: | raziel057 | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.7 |
Component: | ui.resizable | Version: | 1.6rc6 |
Keywords: | resiazable containment | Cc: | |
Blocked by: | Blocking: |
Description
when I set an element resizable with containment: 'parent' and the element is near to the right border of the parent, it moves when resizing quickly using left handle. (It's the same when you resize by using top handle and item is near to bottom border).
In fact I noticed the problem comes from :
$.ui.plugin.add("resizable", "containment",
...
resize: function(event, ui) {
...
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 );
self.offset.left and self.offset.top do not always contains the correct values.
So I suggest you to set the correct values before to initialize woset/hoset by inserting the following lines:
self.offset.left = self.parentData.left+self.position.left; self.offset.top = self.parentData.top+self.position.top;
I made some tests under IE6, FF3 and Chrome and seems to works well.
Attachments (1)
Change History (4)
Changed 14 years ago by
Attachment: | resizable.PNG added |
---|
As result, the bug fix constist in addition of the two lines :
self.offset.left = self.parentData.left+self.position.left;
self.offset.top = self.parentData.top+self.position.top;
In the code: