diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-30 11:48:11 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-05-30 11:48:11 +0000 |
commit | feb96d88fcd916bc0b60f79a815ba96ef72294ff (patch) | |
tree | 8ebef24da60fe49b85331f8435d894effb923024 /ui/source/ui.draggable.js | |
parent | 5f24485abe436f83584cfe795dff5ec84c1f1e65 (diff) | |
download | jquery-ui-feb96d88fcd916bc0b60f79a815ba96ef72294ff.tar.gz jquery-ui-feb96d88fcd916bc0b60f79a815ba96ef72294ff.zip |
draggable: more intersect calculation improvements when connected to sortables
Diffstat (limited to 'ui/source/ui.draggable.js')
-rw-r--r-- | ui/source/ui.draggable.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index 87fe09057..291618c35 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -438,12 +438,9 @@ var sortable = $.data(this, 'sortable');
inst.sortables.push({
instance: sortable,
- offset: sortable.element.offset(),
- width: sortable.element.width(),
- height: sortable.element.height(),
shouldRevert: sortable.options.revert
});
-
+ sortable.refresh(); //Do a one-time refresh at start to refresh the containerCache
sortable.propagate("activate", e, inst);
}
});
@@ -481,18 +478,14 @@ var l = o.left, r = l + o.width,
t = o.top, b = t + o.height;
-
+
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(i) {
-
- if(checkPos.call(inst, {
- left: this.offset.left, top: this.offset.top,
- width: this.width, height: this.height
- })) {
+ if(checkPos.call(inst, this.instance.containerCache)) {
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
if(!this.instance.isOver) {
|