mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
draggable: more intersect calculation improvements when connected to sortables
This commit is contained in:
parent
5f24485abe
commit
feb96d88fc
@ -438,12 +438,9 @@
|
|||||||
var sortable = $.data(this, 'sortable');
|
var sortable = $.data(this, 'sortable');
|
||||||
inst.sortables.push({
|
inst.sortables.push({
|
||||||
instance: sortable,
|
instance: sortable,
|
||||||
offset: sortable.element.offset(),
|
|
||||||
width: sortable.element.width(),
|
|
||||||
height: sortable.element.height(),
|
|
||||||
shouldRevert: sortable.options.revert
|
shouldRevert: sortable.options.revert
|
||||||
});
|
});
|
||||||
|
sortable.refresh(); //Do a one-time refresh at start to refresh the containerCache
|
||||||
sortable.propagate("activate", e, inst);
|
sortable.propagate("activate", e, inst);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -488,11 +485,7 @@
|
|||||||
|
|
||||||
$.each(inst.sortables, function(i) {
|
$.each(inst.sortables, function(i) {
|
||||||
|
|
||||||
|
if(checkPos.call(inst, this.instance.containerCache)) {
|
||||||
if(checkPos.call(inst, {
|
|
||||||
left: this.offset.left, top: this.offset.top,
|
|
||||||
width: this.width, height: this.height
|
|
||||||
})) {
|
|
||||||
|
|
||||||
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
|
//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) {
|
if(!this.instance.isOver) {
|
||||||
|
Loading…
Reference in New Issue
Block a user