]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: more intersect calculation improvements when connected to sortables
authorPaul Bakaus <paul.bakaus@googlemail.com>
Fri, 30 May 2008 11:48:11 +0000 (11:48 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Fri, 30 May 2008 11:48:11 +0000 (11:48 +0000)
ui/source/ui.draggable.js

index 87fe090571c20c4587ef97118f9982a9486c1f50..291618c35e6496b8dbdf969a194221f1036acd2d 100644 (file)
                                        var sortable = $.data(this, 'sortable');\r
                                        inst.sortables.push({\r
                                                instance: sortable,\r
-                                               offset: sortable.element.offset(),\r
-                                               width: sortable.element.width(),\r
-                                               height: sortable.element.height(),\r
                                                shouldRevert: sortable.options.revert\r
                                        });\r
-                                       \r
+                                       sortable.refresh();     //Do a one-time refresh at start to refresh the containerCache  \r
                                        sortable.propagate("activate", e, inst);\r
                                }\r
                        });\r
                                        \r
                                var l = o.left, r = l + o.width,\r
                                        t = o.top, b = t + o.height;\r
-               \r
+       \r
                                return (l < (this.positionAbs.left + this.offset.click.left) && (this.positionAbs.left + this.offset.click.left) < r\r
                                                && t < (this.positionAbs.top + this.offset.click.top) && (this.positionAbs.top + this.offset.click.top) < b);                           \r
                        };\r
                        \r
                        $.each(inst.sortables, function(i) {\r
 \r
-\r
-                               if(checkPos.call(inst, {\r
-                                       left: this.offset.left, top: this.offset.top,\r
-                                       width: this.width, height: this.height\r
-                               })) {\r
+                               if(checkPos.call(inst, this.instance.containerCache)) {\r
 \r
                                        //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once\r
                                        if(!this.instance.isOver) {\r