Skip to content

Commit

Permalink
添加 options.accept 处理接受拖拽的元素
Browse files Browse the repository at this point in the history
  • Loading branch information
why520crazy committed Jul 21, 2016
1 parent 27fa2f9 commit 3b7c331
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
fallbackClass: 'sortable-fallback',
fallbackOnBody: false,
scrollContainer: null,
allowTransform:true
allowTransform: true
};


Expand Down Expand Up @@ -603,6 +603,12 @@
!options.dragoverBubble && evt.stopPropagation();
}

//如果拖动的目标区域 accept 设置了, 当前拖拽元素不满足,直接返回
if (activeGroup && activeGroup.name === group.name
&& evt.rootEl[expando].options.accept
&& !_matches(dragEl, evt.rootEl[expando].options.accept)) {
return;
}
moved = true;

if (activeGroup && !options.disabled &&
Expand Down

0 comments on commit 3b7c331

Please sign in to comment.