Bugfix for JQuery UI 1.7.2 sortable helper

Bugfix for JQuery UI 1.7.2 sortable helper


Hi,
I have spotted a bug in IE6 & IE7 (the bug doesn't shows up on Firefox
3 & IE8) when using sortable with the revert option enabled.
When I drag a portlet the sortable helper seems to jump to an odd
position.
By experimenting a bit, it is apparent that the bug is related to the
scroll position of the page.
I've fixed the problem by modifying the _mouseStop event of the
jquery.ui.sortable.js file (line 304-309) from this :
$(this.helper).animate({
left: cur.left - this.offset.parent.left - self.margins.left +
(this.offsetParent[0] == document.body ? 0 : this.offsetParent
[0].scrollLeft),
top: cur.top - this.offset.parent.top - self.margins.top +
(this.offsetParent[0] == document.body ? 0 : this.offsetParent
[0].scrollTop)
}, parseInt(this.options.revert, 10) || 500, function() {
self._clear(event);
});
to this :
$(this.helper).animate({
left: cur.left - this.offset.parent.left - self.margins.left,
top: cur.top - this.offset.parent.top - self.margins.top
}, parseInt(this.options.revert, 10) || 500, function() {
self._clear(event);
});
I don't know if that's the proper way to fix the problem but it does
the trick.
Regards,
kiz.