From 356ea57634e423511ea22107d3e6bd1d04bf1b6d Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Mon, 26 May 2008 11:24:50 +0000 Subject: sortable: refactored big parts of sortable with new parts of draggable - scrolling problems should be fixed now, as well as many others. --- ui/source/ui.draggable.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'ui/source/ui.draggable.js') diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index 361b9a8d7..21f0b868c 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -456,18 +456,15 @@ }, drag: function(e,ui) { - //This is handy: We reuse the intersectsWith method for checking if the current draggable helper - //intersects with the sortable container var inst = $(this).data("draggable"), self = this; - inst.position.absolute = ui.absolutePosition; //Sorry, this is an ugly API fix var checkPos = function(o) { var l = o.left, r = l + o.width, t = o.top, b = t + o.height; - return (l < (this.position.absolute.left + this.offset.click.left) && (this.position.absolute.left + this.offset.click.left) < r - && t < (this.position.absolute.top + this.offset.click.top) && (this.position.absolute.top + this.offset.click.top) < b); + return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r + && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b); }; $.each(inst.sortables, function() { @@ -490,10 +487,10 @@ this.instance.mouseStart(e, true); //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes - this.instance.clickOffset.top = inst.offset.click.top; - this.instance.clickOffset.left = inst.offset.click.left; - this.instance.offset.left -= ui.absolutePosition.left - this.instance.position.absolute.left; - this.instance.offset.top -= ui.absolutePosition.top - this.instance.position.absolute.top; + this.instance.offset.click.top = inst.offset.click.top; + this.instance.offset.click.left = inst.offset.click.left; + this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left; + this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top; inst.propagate("toSortable", e); -- cgit v1.2.3