|
|
@ -249,6 +249,7 @@ |
|
|
|
dragClass: 'sortable-drag', |
|
|
|
dragClass: 'sortable-drag', |
|
|
|
ignore: 'a, img', |
|
|
|
ignore: 'a, img', |
|
|
|
filter: null, |
|
|
|
filter: null, |
|
|
|
|
|
|
|
preventOnFilter: true, |
|
|
|
animation: 0, |
|
|
|
animation: 0, |
|
|
|
setData: function (dataTransfer, dragEl) { |
|
|
|
setData: function (dataTransfer, dragEl) { |
|
|
|
dataTransfer.setData('Text', dragEl.textContent); |
|
|
|
dataTransfer.setData('Text', dragEl.textContent); |
|
|
@ -306,6 +307,7 @@ |
|
|
|
var _this = this, |
|
|
|
var _this = this, |
|
|
|
el = this.el, |
|
|
|
el = this.el, |
|
|
|
options = this.options, |
|
|
|
options = this.options, |
|
|
|
|
|
|
|
preventOnFilter = preventOnFilter.options, |
|
|
|
type = evt.type, |
|
|
|
type = evt.type, |
|
|
|
touch = evt.touches && evt.touches[0], |
|
|
|
touch = evt.touches && evt.touches[0], |
|
|
|
target = (touch || evt).target, |
|
|
|
target = (touch || evt).target, |
|
|
@ -339,7 +341,7 @@ |
|
|
|
if (typeof filter === 'function') { |
|
|
|
if (typeof filter === 'function') { |
|
|
|
if (filter.call(this, evt, target, this)) { |
|
|
|
if (filter.call(this, evt, target, this)) { |
|
|
|
_dispatchEvent(_this, originalTarget, 'filter', target, el, startIndex); |
|
|
|
_dispatchEvent(_this, originalTarget, 'filter', target, el, startIndex); |
|
|
|
evt.preventDefault(); |
|
|
|
preventOnFilter && evt.preventDefault(); |
|
|
|
return; // cancel dnd
|
|
|
|
return; // cancel dnd
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -354,7 +356,7 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (filter) { |
|
|
|
if (filter) { |
|
|
|
evt.preventDefault(); |
|
|
|
preventOnFilter && evt.preventDefault(); |
|
|
|
return; // cancel dnd
|
|
|
|
return; // cancel dnd
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|