Skip to content

Commit

Permalink
#1471: Use real event properties when doing empty insert
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Mar 17, 2019
1 parent 3692fa8 commit b483211
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
insideHorizontally = x >= (rect.left - threshold) && x <= (rect.right + threshold),
insideVertically = y >= (rect.top - threshold) && y <= (rect.bottom + threshold);

if (insideHorizontally && insideVertically) {
if (threshold && insideHorizontally && insideVertically) {
return sortables[i];
}
}
Expand Down Expand Up @@ -488,12 +488,15 @@
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);

if (nearest) {
nearest[expando]._onDragOver({
clientX: evt.clientX,
clientY: evt.clientY,
target: nearest,
rootEl: nearest
});
// Create imitation event
var event = {};
for (var i in evt) {
event[i] = evt[i];
}
event.target = event.rootEl = nearest;
event.preventDefault = void 0;
event.stopPropagation = void 0;
nearest[expando]._onDragOver(event);
}
}
};
Expand Down

0 comments on commit b483211

Please sign in to comment.