Skip to content

Commit 558c633

Browse files
committed
preformance improvement
1 parent d83734a commit 558c633

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Sortable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ let dragEl,
228228
_detectNearestEmptySortable = function(x, y) {
229229
let ret;
230230
sortables.some((sortable) => {
231-
if (lastChild(sortable)) return;
231+
const threshold = sortable[expando].options.emptyInsertThreshold;
232+
if (!threshold || lastChild(sortable)) return;
232233

233-
let rect = getRect(sortable),
234-
threshold = sortable[expando].options.emptyInsertThreshold,
234+
const rect = getRect(sortable),
235235
insideHorizontally = x >= (rect.left - threshold) && x <= (rect.right + threshold),
236236
insideVertically = y >= (rect.top - threshold) && y <= (rect.bottom + threshold);
237237

0 commit comments

Comments
 (0)