MCPcopy Index your code
hub / github.com/SortableJS/Sortable / toFn

Function toFn

Sortable.js:976–994  ·  view source on GitHub ↗
(value, pull)

Source from the content-addressed store, hash-verified

974 },
975 _prepareGroup = function _prepareGroup(options) {
976 function toFn(value, pull) {
977 return function (to, from, dragEl, evt) {
978 var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
979 if (value == null && (pull || sameGroup)) {
980 // Default pull value
981 // Default pull and put value if same group
982 return true;
983 } else if (value == null || value === false) {
984 return false;
985 } else if (pull && value === 'clone') {
986 return value;
987 } else if (typeof value === 'function') {
988 return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
989 } else {
990 var otherGroup = (pull ? to : from).options.group.name;
991 return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
992 }
993 };
994 }
995 var group = {};
996 var originalGroup = options.group;
997 if (!originalGroup || _typeof(originalGroup) != 'object') {

Callers 1

_prepareGroupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…