Skip to content

Commit 41e3394

Browse files
authored
1.8.1
1 parent 629872b commit 41e3394

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

Sortable.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@
364364
_prepareGroup = function (options) {
365365
function toFn(value, pull) {
366366
return function(to, from, dragEl, evt) {
367-
var ret;
368367
var sameGroup = to.options.group.name &&
369368
from.options.group.name &&
370369
to.options.group.name === from.options.group.name;
@@ -378,7 +377,7 @@
378377
} else if (pull && value === 'clone') {
379378
return value;
380379
} else if (typeof value === 'function') {
381-
return toFn(value(to, from, dragEl, evt));
380+
return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
382381
} else {
383382
var otherGroup = (pull ? to : from).options.group.name;
384383

@@ -860,10 +859,8 @@
860859

861860
if (!this.nativeDraggable || touch) {
862861
if (this.options.supportPointer) {
863-
touch && _on(document, 'touchmove', _preventScroll); // must be touchmove to prevent scroll
864862
_on(document, 'pointermove', this._onTouchMove);
865863
} else if (touch) {
866-
_on(document, 'touchmove', _preventScroll);
867864
_on(document, 'touchmove', this._onTouchMove);
868865
} else {
869866
_on(document, 'mousemove', this._onTouchMove);
@@ -1362,8 +1359,6 @@
13621359
_offUpEvents: function () {
13631360
var ownerDocument = this.el.ownerDocument;
13641361

1365-
_off(document, 'touchmove', _preventScroll);
1366-
_off(document, 'pointermove', _preventScroll);
13671362
_off(document, 'touchmove', this._onTouchMove);
13681363
_off(document, 'pointermove', this._onTouchMove);
13691364
_off(ownerDocument, 'mouseup', this._onDrop);
@@ -2178,12 +2173,6 @@
21782173
}
21792174

21802175

2181-
function _preventScroll(evt) {
2182-
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2183-
evt.preventDefault();
2184-
}
2185-
}
2186-
21872176
/**
21882177
* Returns the "bounding client rect" of given element
21892178
* @param {HTMLElement} el The element whose boundingClientRect is wanted
@@ -2302,6 +2291,13 @@
23022291
return false;
23032292
}
23042293

2294+
// Fixed #973:
2295+
_on(document, 'touchmove', function(evt) {
2296+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2297+
evt.preventDefault();
2298+
}
2299+
});
2300+
23052301

23062302
// Export utils
23072303
Sortable.utils = {
@@ -2336,6 +2332,6 @@
23362332

23372333

23382334
// Export
2339-
Sortable.version = '1.8.0';
2335+
Sortable.version = '1.8.1';
23402336
return Sortable;
23412337
});

0 commit comments

Comments
 (0)