Skip to content

Commit 28a2444

Browse files
committed
1.10.0-rc2
1 parent aeba84e commit 28a2444

File tree

8 files changed

+186
-186
lines changed

8 files changed

+186
-186
lines changed

Sortable.js

+46-46
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**!
2-
* Sortable 1.10.0-rc1
2+
* Sortable 1.10.0-rc2
33
* @author RubaXa <[email protected]>
44
* @author owenm <[email protected]>
55
* @license MIT
@@ -132,7 +132,7 @@
132132
throw new TypeError("Invalid attempt to spread non-iterable instance");
133133
}
134134

135-
var version = "1.10.0-rc1";
135+
var version = "1.10.0-rc2";
136136

137137
function userAgent(pattern) {
138138
return !!navigator.userAgent.match(pattern);
@@ -425,7 +425,7 @@
425425
children = el.children;
426426

427427
while (i < children.length) {
428-
if (children[i].style.display !== 'none' && children[i] !== Sortable$1.ghost && children[i] !== Sortable$1.dragged && closest(children[i], options.draggable, el, false)) {
428+
if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {
429429
if (currentChild === childNum) {
430430
return children[i];
431431
}
@@ -449,7 +449,7 @@
449449
function lastChild(el, selector) {
450450
var last = el.lastElementChild;
451451

452-
while (last && (last === Sortable$1.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
452+
while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
453453
last = last.previousElementSibling;
454454
}
455455

@@ -474,7 +474,7 @@
474474

475475

476476
while (el = el.previousElementSibling) {
477-
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable$1.clone && (!selector || matches(el, selector))) {
477+
if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
478478
index++;
479479
}
480480
}
@@ -636,7 +636,7 @@
636636
var children = [].slice.call(this.el.children);
637637

638638
for (var i in children) {
639-
if (css(children[i], 'display') === 'none' || children[i] === Sortable$1.ghost) continue;
639+
if (css(children[i], 'display') === 'none' || children[i] === Sortable.ghost) continue;
640640
animationStates.push({
641641
target: children[i],
642642
rect: getRect(children[i])
@@ -924,7 +924,7 @@
924924
originalEvent = _ref.evt,
925925
data = _objectWithoutProperties(_ref, ["evt"]);
926926

927-
PluginManager.pluginEvent.bind(Sortable$1)(eventName, sortable, _objectSpread({
927+
PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({
928928
dragEl: dragEl,
929929
parentEl: parentEl,
930930
ghostEl: ghostEl,
@@ -935,7 +935,7 @@
935935
cloneHidden: cloneHidden,
936936
dragStarted: moved,
937937
putSortable: putSortable,
938-
activeSortable: Sortable$1.active,
938+
activeSortable: Sortable.active,
939939
originalEvent: originalEvent,
940940
oldIndex: oldIndex,
941941
oldDraggableIndex: oldDraggableIndex,
@@ -1171,7 +1171,7 @@
11711171
*/
11721172

11731173

1174-
function Sortable$1(el, options) {
1174+
function Sortable(el, options) {
11751175
if (!(el && el.nodeType && el.nodeType === 1)) {
11761176
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
11771177
}
@@ -1223,7 +1223,7 @@
12231223
x: 0,
12241224
y: 0
12251225
},
1226-
supportPointer: Sortable$1.supportPointer !== false && 'PointerEvent' in window,
1226+
supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window,
12271227
emptyInsertThreshold: 5
12281228
};
12291229
PluginManager.initializePlugins(this, el, defaults); // Set default options
@@ -1269,10 +1269,10 @@
12691269
_extends(this, AnimationStateManager());
12701270
}
12711271

1272-
Sortable$1.prototype =
1272+
Sortable.prototype =
12731273
/** @lends Sortable.prototype */
12741274
{
1275-
constructor: Sortable$1,
1275+
constructor: Sortable,
12761276
_isOutsideThisEl: function _isOutsideThisEl(target) {
12771277
if (!this.el.contains(target) && target !== this.el) {
12781278
lastTarget = null;
@@ -1398,7 +1398,7 @@
13981398
nextEl = dragEl.nextSibling;
13991399
lastDownEl = target;
14001400
activeGroup = options.group;
1401-
Sortable$1.dragged = dragEl;
1401+
Sortable.dragged = dragEl;
14021402
tapEvt = {
14031403
target: dragEl,
14041404
clientX: (touch || evt).clientX,
@@ -1413,7 +1413,7 @@
14131413
evt: evt
14141414
});
14151415

1416-
if (Sortable$1.eventCanceled) {
1416+
if (Sortable.eventCanceled) {
14171417
_this._onDrop();
14181418

14191419
return;
@@ -1462,7 +1462,7 @@
14621462
}); // Delay is impossible for native DnD in Edge or IE
14631463

14641464
if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1465-
if (Sortable$1.eventCanceled) {
1465+
if (Sortable.eventCanceled) {
14661466
this._onDrop();
14671467

14681468
return;
@@ -1555,7 +1555,7 @@
15551555

15561556
!fallback && toggleClass(dragEl, options.dragClass, false);
15571557
toggleClass(dragEl, options.ghostClass, true);
1558-
Sortable$1.active = this;
1558+
Sortable.active = this;
15591559
fallback && this._appendGhost(); // Drag start event
15601560

15611561
_dispatchEvent({
@@ -1626,7 +1626,7 @@
16261626
dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1),
16271627
translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)'; // only set the status to dragging, when we are actually dragging
16281628

1629-
if (!Sortable$1.active && !awaitingDragStarted) {
1629+
if (!Sortable.active && !awaitingDragStarted) {
16301630
if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
16311631
return;
16321632
}
@@ -1685,7 +1685,7 @@
16851685
css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
16861686
css(ghostEl, 'zIndex', '100000');
16871687
css(ghostEl, 'pointerEvents', 'none');
1688-
Sortable$1.ghost = ghostEl;
1688+
Sortable.ghost = ghostEl;
16891689
container.appendChild(ghostEl);
16901690
}
16911691
},
@@ -1702,29 +1702,29 @@
17021702
evt: evt
17031703
});
17041704

1705-
if (Sortable$1.eventCanceled) {
1705+
if (Sortable.eventCanceled) {
17061706
this._onDrop();
17071707

17081708
return;
17091709
}
17101710

17111711
pluginEvent('setupClone', this);
17121712

1713-
if (!Sortable$1.eventCanceled) {
1713+
if (!Sortable.eventCanceled) {
17141714
cloneEl = clone(dragEl);
17151715
cloneEl.draggable = false;
17161716
cloneEl.style['will-change'] = '';
17171717

17181718
this._hideClone();
17191719

17201720
toggleClass(cloneEl, this.options.chosenClass, false);
1721-
Sortable$1.clone = cloneEl;
1721+
Sortable.clone = cloneEl;
17221722
} // #1143: IFrame support workaround
17231723

17241724

17251725
_this.cloneId = _nextTick(function () {
17261726
pluginEvent('clone', _this);
1727-
if (Sortable$1.eventCanceled) return;
1727+
if (Sortable.eventCanceled) return;
17281728

17291729
if (!_this.options.removeCloneOnHide) {
17301730
rootEl.insertBefore(cloneEl, dragEl);
@@ -1778,7 +1778,7 @@
17781778
revert,
17791779
options = this.options,
17801780
group = options.group,
1781-
activeSortable = Sortable$1.active,
1781+
activeSortable = Sortable.active,
17821782
isOwner = activeGroup === group,
17831783
canSort = options.sort,
17841784
fromSortable = putSortable || activeSortable,
@@ -1838,9 +1838,9 @@
18381838
toggleClass(dragEl, options.ghostClass, true);
18391839
}
18401840

1841-
if (putSortable !== _this && _this !== Sortable$1.active) {
1841+
if (putSortable !== _this && _this !== Sortable.active) {
18421842
putSortable = _this;
1843-
} else if (_this === Sortable$1.active && putSortable) {
1843+
} else if (_this === Sortable.active && putSortable) {
18441844
putSortable = null;
18451845
} // Animation
18461846

@@ -1898,7 +1898,7 @@
18981898

18991899
target = closest(target, options.draggable, el, true);
19001900
dragOverEvent('dragOver');
1901-
if (Sortable$1.eventCanceled) return completedFired;
1901+
if (Sortable.eventCanceled) return completedFired;
19021902

19031903
if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
19041904
return completed(false);
@@ -1911,7 +1911,7 @@
19111911
vertical = this._getDirection(evt, target) === 'vertical';
19121912
dragRect = getRect(dragEl);
19131913
dragOverEvent('dragOverValid');
1914-
if (Sortable$1.eventCanceled) return completedFired;
1914+
if (Sortable.eventCanceled) return completedFired;
19151915

19161916
if (revert) {
19171917
parentEl = rootEl; // actualization
@@ -1922,7 +1922,7 @@
19221922

19231923
dragOverEvent('revert');
19241924

1925-
if (!Sortable$1.eventCanceled) {
1925+
if (!Sortable.eventCanceled) {
19261926
if (nextEl) {
19271927
rootEl.insertBefore(dragEl, nextEl);
19281928
} else {
@@ -2071,7 +2071,7 @@
20712071
newIndex = index(dragEl);
20722072
newDraggableIndex = index(dragEl, options.draggable);
20732073

2074-
if (Sortable$1.eventCanceled) {
2074+
if (Sortable.eventCanceled) {
20752075
this._nulling();
20762076

20772077
return;
@@ -2197,7 +2197,7 @@
21972197
}
21982198
}
21992199

2200-
if (Sortable$1.active) {
2200+
if (Sortable.active) {
22012201
/* jshint eqnull:true */
22022202
if (newIndex == null || newIndex === -1) {
22032203
newIndex = oldIndex;
@@ -2221,7 +2221,7 @@
22212221
},
22222222
_nulling: function _nulling() {
22232223
pluginEvent('nulling', this);
2224-
rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable$1.dragged = Sortable$1.ghost = Sortable$1.clone = Sortable$1.active = null;
2224+
rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
22252225
savedInputChecked.forEach(function (el) {
22262226
el.checked = true;
22272227
});
@@ -2371,7 +2371,7 @@
23712371
_hideClone: function _hideClone() {
23722372
if (!cloneHidden) {
23732373
pluginEvent('hideClone', this);
2374-
if (Sortable$1.eventCanceled) return;
2374+
if (Sortable.eventCanceled) return;
23752375
css(cloneEl, 'display', 'none');
23762376

23772377
if (this.options.removeCloneOnHide && cloneEl.parentNode) {
@@ -2390,7 +2390,7 @@
23902390

23912391
if (cloneHidden) {
23922392
pluginEvent('showClone', this);
2393-
if (Sortable$1.eventCanceled) return; // show clone at dragEl or original position
2393+
if (Sortable.eventCanceled) return; // show clone at dragEl or original position
23942394

23952395
if (rootEl.contains(dragEl) && !this.options.group.revertClone) {
23962396
rootEl.insertBefore(cloneEl, dragEl);
@@ -2569,12 +2569,12 @@
25692569

25702570

25712571
on(document, 'touchmove', function (evt) {
2572-
if ((Sortable$1.active || awaitingDragStarted) && evt.cancelable) {
2572+
if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
25732573
evt.preventDefault();
25742574
}
25752575
}); // Export utils
25762576

2577-
Sortable$1.utils = {
2577+
Sortable.utils = {
25782578
on: on,
25792579
off: off,
25802580
css: css,
@@ -2598,7 +2598,7 @@
25982598
* @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
25992599
*/
26002600

2601-
Sortable$1.mount = function () {
2601+
Sortable.mount = function () {
26022602
for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
26032603
plugins[_key] = arguments[_key];
26042604
}
@@ -2612,7 +2612,7 @@
26122612
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(el));
26132613
}
26142614

2615-
if (plugin.utils) Sortable$1.utils = _objectSpread({}, Sortable$1.utils, plugin.utils);
2615+
if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);
26162616
PluginManager.mount(plugin);
26172617
}
26182618
};
@@ -2623,12 +2623,12 @@
26232623
*/
26242624

26252625

2626-
Sortable$1.create = function (el, options) {
2627-
return new Sortable$1(el, options);
2626+
Sortable.create = function (el, options) {
2627+
return new Sortable(el, options);
26282628
}; // Export
26292629

26302630

2631-
Sortable$1.version = version;
2631+
Sortable.version = version;
26322632

26332633
var autoScrolls = [],
26342634
scrollEl,
@@ -3392,7 +3392,7 @@
33923392
// Do not "unfold" after around dragEl if reverted
33933393
if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
33943394
var dragRect = getRect(dragEl$1),
3395-
multiDragIndex = index(dragEl$1, ':not(.' + Sortable.active.options.selectedClass + ')');
3395+
multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');
33963396
if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;
33973397
toSortable.captureAnimationState();
33983398

@@ -3632,12 +3632,12 @@
36323632
}
36333633
}
36343634

3635-
Sortable$1.mount(new AutoScrollPlugin());
3636-
Sortable$1.mount(Remove, Revert);
3635+
Sortable.mount(new AutoScrollPlugin());
3636+
Sortable.mount(Remove, Revert);
36373637

3638-
Sortable$1.mount(new SwapPlugin());
3639-
Sortable$1.mount(new MultiDragPlugin());
3638+
Sortable.mount(new SwapPlugin());
3639+
Sortable.mount(new MultiDragPlugin());
36403640

3641-
return Sortable$1;
3641+
return Sortable;
36423642

36433643
}));

Sortable.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)