sortablejs 1.15.2 → 1.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * Sortable 1.15.2
2
+ * Sortable 1.15.6
3
3
  * @author RubaXa <trash@rubaxa.org>
4
4
  * @author owenm <owen23355@gmail.com>
5
5
  * @license MIT
@@ -128,7 +128,7 @@ function _nonIterableSpread() {
128
128
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
129
129
  }
130
130
 
131
- var version = "1.15.2";
131
+ var version = "1.15.6";
132
132
 
133
133
  function userAgent(pattern) {
134
134
  if (typeof window !== 'undefined' && window.navigator) {
@@ -1121,7 +1121,8 @@ function Sortable(el, options) {
1121
1121
  x: 0,
1122
1122
  y: 0
1123
1123
  },
1124
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1124
+ // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
1125
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
1125
1126
  emptyInsertThreshold: 5
1126
1127
  };
1127
1128
  PluginManager.initializePlugins(this, el, defaults);
@@ -1232,7 +1233,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1232
1233
  pluginEvent('filter', _this, {
1233
1234
  evt: evt
1234
1235
  });
1235
- preventOnFilter && evt.cancelable && evt.preventDefault();
1236
+ preventOnFilter && evt.preventDefault();
1236
1237
  return; // cancel dnd
1237
1238
  }
1238
1239
  } else if (filter) {
@@ -1254,7 +1255,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1254
1255
  }
1255
1256
  });
1256
1257
  if (filter) {
1257
- preventOnFilter && evt.cancelable && evt.preventDefault();
1258
+ preventOnFilter && evt.preventDefault();
1258
1259
  return; // cancel dnd
1259
1260
  }
1260
1261
  }
@@ -1326,9 +1327,15 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1326
1327
  on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1327
1328
  on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1328
1329
  on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1329
- on(ownerDocument, 'mouseup', _this._onDrop);
1330
- on(ownerDocument, 'touchend', _this._onDrop);
1331
- on(ownerDocument, 'touchcancel', _this._onDrop);
1330
+ if (options.supportPointer) {
1331
+ on(ownerDocument, 'pointerup', _this._onDrop);
1332
+ // Native D&D triggers pointercancel
1333
+ !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
1334
+ } else {
1335
+ on(ownerDocument, 'mouseup', _this._onDrop);
1336
+ on(ownerDocument, 'touchend', _this._onDrop);
1337
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1338
+ }
1332
1339
 
1333
1340
  // Make dragEl draggable (must be before delay for FireFox)
1334
1341
  if (FireFox && this.nativeDraggable) {
@@ -1348,9 +1355,14 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1348
1355
  // If the user moves the pointer or let go the click or touch
1349
1356
  // before the delay has been reached:
1350
1357
  // disable the delayed drag
1351
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1352
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1353
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1358
+ if (options.supportPointer) {
1359
+ on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
1360
+ on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
1361
+ } else {
1362
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1363
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1364
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1365
+ }
1354
1366
  on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1355
1367
  on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1356
1368
  options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
@@ -1376,6 +1388,8 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1376
1388
  off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1377
1389
  off(ownerDocument, 'touchend', this._disableDelayedDrag);
1378
1390
  off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1391
+ off(ownerDocument, 'pointerup', this._disableDelayedDrag);
1392
+ off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
1379
1393
  off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1380
1394
  off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1381
1395
  off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
@@ -1396,7 +1410,6 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1396
1410
  }
1397
1411
  try {
1398
1412
  if (document.selection) {
1399
- // Timeout neccessary for IE9
1400
1413
  _nextTick(function () {
1401
1414
  document.selection.empty();
1402
1415
  });
@@ -1461,7 +1474,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1461
1474
  }
1462
1475
  target = parent; // store last element
1463
1476
  }
1464
- /* jshint boss:true */ while (parent = parent.parentNode);
1477
+ /* jshint boss:true */ while (parent = getParentOrHost(parent));
1465
1478
  }
1466
1479
  _unhideGhostForTarget();
1467
1480
  }
@@ -1618,6 +1631,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1618
1631
  _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1619
1632
  on(document, 'selectstart', _this);
1620
1633
  moved = true;
1634
+ window.getSelection().removeAllRanges();
1621
1635
  if (Safari) {
1622
1636
  css(document.body, 'user-select', 'none');
1623
1637
  }
@@ -1889,6 +1903,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1889
1903
  off(ownerDocument, 'mouseup', this._onDrop);
1890
1904
  off(ownerDocument, 'touchend', this._onDrop);
1891
1905
  off(ownerDocument, 'pointerup', this._onDrop);
1906
+ off(ownerDocument, 'pointercancel', this._onDrop);
1892
1907
  off(ownerDocument, 'touchcancel', this._onDrop);
1893
1908
  off(document, 'selectstart', this);
1894
1909
  },
@@ -2367,7 +2382,8 @@ Sortable.utils = {
2367
2382
  nextTick: _nextTick,
2368
2383
  cancelNextTick: _cancelNextTick,
2369
2384
  detectDirection: _detectDirection,
2370
- getChild: getChild
2385
+ getChild: getChild,
2386
+ expando: expando
2371
2387
  };
2372
2388
 
2373
2389
  /**
@@ -3078,28 +3094,38 @@ function MultiDragPlugin() {
3078
3094
  var lastIndex = index(lastMultiDragSelect),
3079
3095
  currentIndex = index(dragEl$1);
3080
3096
  if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
3081
- // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3082
- // (but previous selection existed)
3083
- var n, i;
3084
- if (currentIndex > lastIndex) {
3085
- i = lastIndex;
3086
- n = currentIndex;
3087
- } else {
3088
- i = currentIndex;
3089
- n = lastIndex + 1;
3090
- }
3091
- for (; i < n; i++) {
3092
- if (~multiDragElements.indexOf(children[i])) continue;
3093
- toggleClass(children[i], options.selectedClass, true);
3094
- multiDragElements.push(children[i]);
3095
- dispatchEvent({
3096
- sortable: sortable,
3097
- rootEl: rootEl,
3098
- name: 'select',
3099
- targetEl: children[i],
3100
- originalEvent: evt
3101
- });
3102
- }
3097
+ (function () {
3098
+ // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3099
+ // (but previous selection existed)
3100
+ var n, i;
3101
+ if (currentIndex > lastIndex) {
3102
+ i = lastIndex;
3103
+ n = currentIndex;
3104
+ } else {
3105
+ i = currentIndex;
3106
+ n = lastIndex + 1;
3107
+ }
3108
+ var filter = options.filter;
3109
+ for (; i < n; i++) {
3110
+ if (~multiDragElements.indexOf(children[i])) continue;
3111
+ // Check if element is draggable
3112
+ if (!closest(children[i], options.draggable, parentEl, false)) continue;
3113
+ // Check if element is filtered
3114
+ var filtered = filter && (typeof filter === 'function' ? filter.call(sortable, evt, children[i], sortable) : filter.split(',').some(function (criteria) {
3115
+ return closest(children[i], criteria.trim(), parentEl, false);
3116
+ }));
3117
+ if (filtered) continue;
3118
+ toggleClass(children[i], options.selectedClass, true);
3119
+ multiDragElements.push(children[i]);
3120
+ dispatchEvent({
3121
+ sortable: sortable,
3122
+ rootEl: rootEl,
3123
+ name: 'select',
3124
+ targetEl: children[i],
3125
+ originalEvent: evt
3126
+ });
3127
+ }
3128
+ })();
3103
3129
  }
3104
3130
  } else {
3105
3131
  lastMultiDragSelect = dragEl$1;
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * Sortable 1.15.2
2
+ * Sortable 1.15.6
3
3
  * @author RubaXa <trash@rubaxa.org>
4
4
  * @author owenm <owen23355@gmail.com>
5
5
  * @license MIT
@@ -128,7 +128,7 @@ function _nonIterableSpread() {
128
128
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
129
129
  }
130
130
 
131
- var version = "1.15.2";
131
+ var version = "1.15.6";
132
132
 
133
133
  function userAgent(pattern) {
134
134
  if (typeof window !== 'undefined' && window.navigator) {
@@ -1121,7 +1121,8 @@ function Sortable(el, options) {
1121
1121
  x: 0,
1122
1122
  y: 0
1123
1123
  },
1124
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1124
+ // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
1125
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
1125
1126
  emptyInsertThreshold: 5
1126
1127
  };
1127
1128
  PluginManager.initializePlugins(this, el, defaults);
@@ -1232,7 +1233,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1232
1233
  pluginEvent('filter', _this, {
1233
1234
  evt: evt
1234
1235
  });
1235
- preventOnFilter && evt.cancelable && evt.preventDefault();
1236
+ preventOnFilter && evt.preventDefault();
1236
1237
  return; // cancel dnd
1237
1238
  }
1238
1239
  } else if (filter) {
@@ -1254,7 +1255,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1254
1255
  }
1255
1256
  });
1256
1257
  if (filter) {
1257
- preventOnFilter && evt.cancelable && evt.preventDefault();
1258
+ preventOnFilter && evt.preventDefault();
1258
1259
  return; // cancel dnd
1259
1260
  }
1260
1261
  }
@@ -1326,9 +1327,15 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1326
1327
  on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1327
1328
  on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1328
1329
  on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1329
- on(ownerDocument, 'mouseup', _this._onDrop);
1330
- on(ownerDocument, 'touchend', _this._onDrop);
1331
- on(ownerDocument, 'touchcancel', _this._onDrop);
1330
+ if (options.supportPointer) {
1331
+ on(ownerDocument, 'pointerup', _this._onDrop);
1332
+ // Native D&D triggers pointercancel
1333
+ !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
1334
+ } else {
1335
+ on(ownerDocument, 'mouseup', _this._onDrop);
1336
+ on(ownerDocument, 'touchend', _this._onDrop);
1337
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1338
+ }
1332
1339
 
1333
1340
  // Make dragEl draggable (must be before delay for FireFox)
1334
1341
  if (FireFox && this.nativeDraggable) {
@@ -1348,9 +1355,14 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1348
1355
  // If the user moves the pointer or let go the click or touch
1349
1356
  // before the delay has been reached:
1350
1357
  // disable the delayed drag
1351
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1352
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1353
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1358
+ if (options.supportPointer) {
1359
+ on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
1360
+ on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
1361
+ } else {
1362
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1363
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1364
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1365
+ }
1354
1366
  on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1355
1367
  on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1356
1368
  options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
@@ -1376,6 +1388,8 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1376
1388
  off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1377
1389
  off(ownerDocument, 'touchend', this._disableDelayedDrag);
1378
1390
  off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1391
+ off(ownerDocument, 'pointerup', this._disableDelayedDrag);
1392
+ off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
1379
1393
  off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1380
1394
  off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1381
1395
  off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
@@ -1396,7 +1410,6 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1396
1410
  }
1397
1411
  try {
1398
1412
  if (document.selection) {
1399
- // Timeout neccessary for IE9
1400
1413
  _nextTick(function () {
1401
1414
  document.selection.empty();
1402
1415
  });
@@ -1461,7 +1474,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1461
1474
  }
1462
1475
  target = parent; // store last element
1463
1476
  }
1464
- /* jshint boss:true */ while (parent = parent.parentNode);
1477
+ /* jshint boss:true */ while (parent = getParentOrHost(parent));
1465
1478
  }
1466
1479
  _unhideGhostForTarget();
1467
1480
  }
@@ -1618,6 +1631,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1618
1631
  _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1619
1632
  on(document, 'selectstart', _this);
1620
1633
  moved = true;
1634
+ window.getSelection().removeAllRanges();
1621
1635
  if (Safari) {
1622
1636
  css(document.body, 'user-select', 'none');
1623
1637
  }
@@ -1889,6 +1903,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1889
1903
  off(ownerDocument, 'mouseup', this._onDrop);
1890
1904
  off(ownerDocument, 'touchend', this._onDrop);
1891
1905
  off(ownerDocument, 'pointerup', this._onDrop);
1906
+ off(ownerDocument, 'pointercancel', this._onDrop);
1892
1907
  off(ownerDocument, 'touchcancel', this._onDrop);
1893
1908
  off(document, 'selectstart', this);
1894
1909
  },
@@ -2367,7 +2382,8 @@ Sortable.utils = {
2367
2382
  nextTick: _nextTick,
2368
2383
  cancelNextTick: _cancelNextTick,
2369
2384
  detectDirection: _detectDirection,
2370
- getChild: getChild
2385
+ getChild: getChild,
2386
+ expando: expando
2371
2387
  };
2372
2388
 
2373
2389
  /**
@@ -3079,28 +3095,38 @@ function MultiDragPlugin() {
3079
3095
  var lastIndex = index(lastMultiDragSelect),
3080
3096
  currentIndex = index(dragEl$1);
3081
3097
  if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
3082
- // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3083
- // (but previous selection existed)
3084
- var n, i;
3085
- if (currentIndex > lastIndex) {
3086
- i = lastIndex;
3087
- n = currentIndex;
3088
- } else {
3089
- i = currentIndex;
3090
- n = lastIndex + 1;
3091
- }
3092
- for (; i < n; i++) {
3093
- if (~multiDragElements.indexOf(children[i])) continue;
3094
- toggleClass(children[i], options.selectedClass, true);
3095
- multiDragElements.push(children[i]);
3096
- dispatchEvent({
3097
- sortable: sortable,
3098
- rootEl: rootEl,
3099
- name: 'select',
3100
- targetEl: children[i],
3101
- originalEvent: evt
3102
- });
3103
- }
3098
+ (function () {
3099
+ // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3100
+ // (but previous selection existed)
3101
+ var n, i;
3102
+ if (currentIndex > lastIndex) {
3103
+ i = lastIndex;
3104
+ n = currentIndex;
3105
+ } else {
3106
+ i = currentIndex;
3107
+ n = lastIndex + 1;
3108
+ }
3109
+ var filter = options.filter;
3110
+ for (; i < n; i++) {
3111
+ if (~multiDragElements.indexOf(children[i])) continue;
3112
+ // Check if element is draggable
3113
+ if (!closest(children[i], options.draggable, parentEl, false)) continue;
3114
+ // Check if element is filtered
3115
+ var filtered = filter && (typeof filter === 'function' ? filter.call(sortable, evt, children[i], sortable) : filter.split(',').some(function (criteria) {
3116
+ return closest(children[i], criteria.trim(), parentEl, false);
3117
+ }));
3118
+ if (filtered) continue;
3119
+ toggleClass(children[i], options.selectedClass, true);
3120
+ multiDragElements.push(children[i]);
3121
+ dispatchEvent({
3122
+ sortable: sortable,
3123
+ rootEl: rootEl,
3124
+ name: 'select',
3125
+ targetEl: children[i],
3126
+ originalEvent: evt
3127
+ });
3128
+ }
3129
+ })();
3104
3130
  }
3105
3131
  } else {
3106
3132
  lastMultiDragSelect = dragEl$1;
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * Sortable 1.15.2
2
+ * Sortable 1.15.6
3
3
  * @author RubaXa <trash@rubaxa.org>
4
4
  * @author owenm <owen23355@gmail.com>
5
5
  * @license MIT
@@ -128,7 +128,7 @@ function _nonIterableSpread() {
128
128
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
129
129
  }
130
130
 
131
- var version = "1.15.2";
131
+ var version = "1.15.6";
132
132
 
133
133
  function userAgent(pattern) {
134
134
  if (typeof window !== 'undefined' && window.navigator) {
@@ -1121,7 +1121,8 @@ function Sortable(el, options) {
1121
1121
  x: 0,
1122
1122
  y: 0
1123
1123
  },
1124
- supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1124
+ // Disabled on Safari: #1571; Enabled on Safari IOS: #2244
1125
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),
1125
1126
  emptyInsertThreshold: 5
1126
1127
  };
1127
1128
  PluginManager.initializePlugins(this, el, defaults);
@@ -1232,7 +1233,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1232
1233
  pluginEvent('filter', _this, {
1233
1234
  evt: evt
1234
1235
  });
1235
- preventOnFilter && evt.cancelable && evt.preventDefault();
1236
+ preventOnFilter && evt.preventDefault();
1236
1237
  return; // cancel dnd
1237
1238
  }
1238
1239
  } else if (filter) {
@@ -1254,7 +1255,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1254
1255
  }
1255
1256
  });
1256
1257
  if (filter) {
1257
- preventOnFilter && evt.cancelable && evt.preventDefault();
1258
+ preventOnFilter && evt.preventDefault();
1258
1259
  return; // cancel dnd
1259
1260
  }
1260
1261
  }
@@ -1326,9 +1327,15 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1326
1327
  on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1327
1328
  on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1328
1329
  on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1329
- on(ownerDocument, 'mouseup', _this._onDrop);
1330
- on(ownerDocument, 'touchend', _this._onDrop);
1331
- on(ownerDocument, 'touchcancel', _this._onDrop);
1330
+ if (options.supportPointer) {
1331
+ on(ownerDocument, 'pointerup', _this._onDrop);
1332
+ // Native D&D triggers pointercancel
1333
+ !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);
1334
+ } else {
1335
+ on(ownerDocument, 'mouseup', _this._onDrop);
1336
+ on(ownerDocument, 'touchend', _this._onDrop);
1337
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1338
+ }
1332
1339
 
1333
1340
  // Make dragEl draggable (must be before delay for FireFox)
1334
1341
  if (FireFox && this.nativeDraggable) {
@@ -1348,9 +1355,14 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1348
1355
  // If the user moves the pointer or let go the click or touch
1349
1356
  // before the delay has been reached:
1350
1357
  // disable the delayed drag
1351
- on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1352
- on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1353
- on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1358
+ if (options.supportPointer) {
1359
+ on(ownerDocument, 'pointerup', _this._disableDelayedDrag);
1360
+ on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);
1361
+ } else {
1362
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1363
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1364
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1365
+ }
1354
1366
  on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1355
1367
  on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1356
1368
  options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
@@ -1376,6 +1388,8 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1376
1388
  off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1377
1389
  off(ownerDocument, 'touchend', this._disableDelayedDrag);
1378
1390
  off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1391
+ off(ownerDocument, 'pointerup', this._disableDelayedDrag);
1392
+ off(ownerDocument, 'pointercancel', this._disableDelayedDrag);
1379
1393
  off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1380
1394
  off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1381
1395
  off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
@@ -1396,7 +1410,6 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1396
1410
  }
1397
1411
  try {
1398
1412
  if (document.selection) {
1399
- // Timeout neccessary for IE9
1400
1413
  _nextTick(function () {
1401
1414
  document.selection.empty();
1402
1415
  });
@@ -1461,7 +1474,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1461
1474
  }
1462
1475
  target = parent; // store last element
1463
1476
  }
1464
- /* jshint boss:true */ while (parent = parent.parentNode);
1477
+ /* jshint boss:true */ while (parent = getParentOrHost(parent));
1465
1478
  }
1466
1479
  _unhideGhostForTarget();
1467
1480
  }
@@ -1618,6 +1631,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1618
1631
  _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1619
1632
  on(document, 'selectstart', _this);
1620
1633
  moved = true;
1634
+ window.getSelection().removeAllRanges();
1621
1635
  if (Safari) {
1622
1636
  css(document.body, 'user-select', 'none');
1623
1637
  }
@@ -1889,6 +1903,7 @@ Sortable.prototype = /** @lends Sortable.prototype */{
1889
1903
  off(ownerDocument, 'mouseup', this._onDrop);
1890
1904
  off(ownerDocument, 'touchend', this._onDrop);
1891
1905
  off(ownerDocument, 'pointerup', this._onDrop);
1906
+ off(ownerDocument, 'pointercancel', this._onDrop);
1892
1907
  off(ownerDocument, 'touchcancel', this._onDrop);
1893
1908
  off(document, 'selectstart', this);
1894
1909
  },
@@ -2367,7 +2382,8 @@ Sortable.utils = {
2367
2382
  nextTick: _nextTick,
2368
2383
  cancelNextTick: _cancelNextTick,
2369
2384
  detectDirection: _detectDirection,
2370
- getChild: getChild
2385
+ getChild: getChild,
2386
+ expando: expando
2371
2387
  };
2372
2388
 
2373
2389
  /**
@@ -3078,28 +3094,38 @@ function MultiDragPlugin() {
3078
3094
  var lastIndex = index(lastMultiDragSelect),
3079
3095
  currentIndex = index(dragEl$1);
3080
3096
  if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
3081
- // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3082
- // (but previous selection existed)
3083
- var n, i;
3084
- if (currentIndex > lastIndex) {
3085
- i = lastIndex;
3086
- n = currentIndex;
3087
- } else {
3088
- i = currentIndex;
3089
- n = lastIndex + 1;
3090
- }
3091
- for (; i < n; i++) {
3092
- if (~multiDragElements.indexOf(children[i])) continue;
3093
- toggleClass(children[i], options.selectedClass, true);
3094
- multiDragElements.push(children[i]);
3095
- dispatchEvent({
3096
- sortable: sortable,
3097
- rootEl: rootEl,
3098
- name: 'select',
3099
- targetEl: children[i],
3100
- originalEvent: evt
3101
- });
3102
- }
3097
+ (function () {
3098
+ // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3099
+ // (but previous selection existed)
3100
+ var n, i;
3101
+ if (currentIndex > lastIndex) {
3102
+ i = lastIndex;
3103
+ n = currentIndex;
3104
+ } else {
3105
+ i = currentIndex;
3106
+ n = lastIndex + 1;
3107
+ }
3108
+ var filter = options.filter;
3109
+ for (; i < n; i++) {
3110
+ if (~multiDragElements.indexOf(children[i])) continue;
3111
+ // Check if element is draggable
3112
+ if (!closest(children[i], options.draggable, parentEl, false)) continue;
3113
+ // Check if element is filtered
3114
+ var filtered = filter && (typeof filter === 'function' ? filter.call(sortable, evt, children[i], sortable) : filter.split(',').some(function (criteria) {
3115
+ return closest(children[i], criteria.trim(), parentEl, false);
3116
+ }));
3117
+ if (filtered) continue;
3118
+ toggleClass(children[i], options.selectedClass, true);
3119
+ multiDragElements.push(children[i]);
3120
+ dispatchEvent({
3121
+ sortable: sortable,
3122
+ rootEl: rootEl,
3123
+ name: 'select',
3124
+ targetEl: children[i],
3125
+ originalEvent: evt
3126
+ });
3127
+ }
3128
+ })();
3103
3129
  }
3104
3130
  } else {
3105
3131
  lastMultiDragSelect = dragEl$1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sortablejs",
3
3
  "exportName": "Sortable",
4
- "version": "1.15.2",
4
+ "version": "1.15.6",
5
5
  "devDependencies": {
6
6
  "@babel/core": "^7.4.4",
7
7
  "@babel/plugin-transform-object-assign": "^7.2.0",
@@ -39,7 +39,8 @@
39
39
  "files": [
40
40
  "Sortable.js",
41
41
  "Sortable.min.js",
42
- "modular/"
42
+ "modular/",
43
+ "src/"
43
44
  ],
44
45
  "keywords": [
45
46
  "sortable",