Skip to content

Commit

Permalink
1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
owen-m1 committed Jan 16, 2019
1 parent 629872b commit 41e3394
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
22 changes: 9 additions & 13 deletions Sortable.js
Expand Up @@ -364,7 +364,6 @@
_prepareGroup = function (options) {
function toFn(value, pull) {
return function(to, from, dragEl, evt) {
var ret;
var sameGroup = to.options.group.name &&
from.options.group.name &&
to.options.group.name === from.options.group.name;
Expand All @@ -378,7 +377,7 @@
} else if (pull && value === 'clone') {
return value;
} else if (typeof value === 'function') {
return toFn(value(to, from, dragEl, evt));
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
} else {
var otherGroup = (pull ? to : from).options.group.name;

Expand Down Expand Up @@ -860,10 +859,8 @@

if (!this.nativeDraggable || touch) {
if (this.options.supportPointer) {
touch && _on(document, 'touchmove', _preventScroll); // must be touchmove to prevent scroll
_on(document, 'pointermove', this._onTouchMove);
} else if (touch) {
_on(document, 'touchmove', _preventScroll);
_on(document, 'touchmove', this._onTouchMove);
} else {
_on(document, 'mousemove', this._onTouchMove);
Expand Down Expand Up @@ -1362,8 +1359,6 @@
_offUpEvents: function () {
var ownerDocument = this.el.ownerDocument;

_off(document, 'touchmove', _preventScroll);
_off(document, 'pointermove', _preventScroll);
_off(document, 'touchmove', this._onTouchMove);
_off(document, 'pointermove', this._onTouchMove);
_off(ownerDocument, 'mouseup', this._onDrop);
Expand Down Expand Up @@ -2178,12 +2173,6 @@
}


function _preventScroll(evt) {
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
evt.preventDefault();
}
}

/**
* Returns the "bounding client rect" of given element
* @param {HTMLElement} el The element whose boundingClientRect is wanted
Expand Down Expand Up @@ -2302,6 +2291,13 @@
return false;
}

// Fixed #973:
_on(document, 'touchmove', function(evt) {
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
evt.preventDefault();
}
});


// Export utils
Sortable.utils = {
Expand Down Expand Up @@ -2336,6 +2332,6 @@


// Export
Sortable.version = '1.8.0';
Sortable.version = '1.8.1';
return Sortable;
});

0 comments on commit 41e3394

Please sign in to comment.