Skip to content

Commit ccf777a

Browse files
committed
fix: handle does not take effect
1 parent a4d8e9e commit ccf777a

File tree

3 files changed

+43
-42
lines changed

3 files changed

+43
-42
lines changed

dist/virtual-list.js

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-sortable v2.0.0
2+
* vue-virtual-sortable v2.0.1
33
* open source under the MIT license
44
* https://github.com/mfuu/vue-virtual-sortable#readme
55
*/
@@ -270,7 +270,7 @@
270270
var sortableDnd_min = {exports: {}};
271271

272272
/*!
273-
* sortable-dnd v0.6.22
273+
* sortable-dnd v0.6.23
274274
* open source under the MIT license
275275
* https://github.com/mfuu/sortable-dnd#readme
276276
*/
@@ -280,21 +280,21 @@
280280
module.exports = e() ;
281281
}(commonjsGlobal, function () {
282282

283-
function t(e) {
284-
return t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
285-
return typeof t;
286-
} : function (t) {
287-
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
288-
}, t(e);
289-
}
290-
function e() {
291-
return e = Object.assign ? Object.assign.bind() : function (t) {
283+
function t() {
284+
return t = Object.assign ? Object.assign.bind() : function (t) {
292285
for (var e = 1; e < arguments.length; e++) {
293286
var n = arguments[e];
294-
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
287+
for (var o in n) ({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
295288
}
296289
return t;
297-
}, e.apply(this, arguments);
290+
}, t.apply(null, arguments);
291+
}
292+
function e(t) {
293+
return e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
294+
return typeof t;
295+
} : function (t) {
296+
return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
297+
}, e(t);
298298
}
299299
var n = {
300300
capture: !1,
@@ -435,12 +435,12 @@
435435
function x(t) {
436436
void 0 !== t.preventDefault && t.cancelable && t.preventDefault();
437437
}
438-
function C(t) {
439-
var n = t.sortable,
440-
o = t.name,
441-
i = t.evt,
438+
function C(e) {
439+
var n = e.sortable,
440+
o = e.name,
441+
i = e.evt,
442442
r = n.options[o];
443-
"function" == typeof r && r(e({}, i));
443+
"function" == typeof r && r(t({}, i));
444444
}
445445
!function () {
446446
if ("undefined" == typeof window || "undefined" == typeof document) return "";
@@ -657,26 +657,26 @@
657657
Z,
658658
$,
659659
tt = [];
660-
function et(e) {
660+
function et(t) {
661661
var n,
662662
o,
663663
i,
664664
r = {},
665-
s = e.group;
666-
s && "object" === t(s) || (s = {
665+
s = t.group;
666+
s && "object" === e(s) || (s = {
667667
name: s,
668668
pull: !0,
669669
put: !0,
670670
revertDrag: !0
671-
}), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, e.group = r;
671+
}), r.name = s.name, r.pull = null === (n = s.pull) || void 0 === n || n, r.put = null === (o = s.put) || void 0 === o || o, r.revertDrag = null === (i = s.revertDrag) || void 0 === i || i, t.group = r;
672672
}
673673
function nt(t) {
674674
var e = F || U;
675675
return !(void 0 !== t.clientX && void 0 !== t.clientY && Math.abs(t.clientX - e.clientX) <= 0 && Math.abs(t.clientY - e.clientY) <= 0);
676676
}
677-
function ot(t, n) {
678-
if (!t || !t.nodeType || 1 !== t.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(t));
679-
t[M] = this, this.el = t, this.options = n = e({}, n);
677+
function ot(e, n) {
678+
if (!e || !e.nodeType || 1 !== e.nodeType) throw "Sortable-dnd: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
679+
e[M] = this, this.el = e, this.options = n = t({}, n);
680680
var o = {
681681
store: null,
682682
group: "",
@@ -713,7 +713,7 @@
713713
};
714714
for (var i in o) !(i in this.options) && (this.options[i] = o[i]);
715715
for (var r in et(n), this) "_" === r.charAt(0) && "function" == typeof this[r] && (this[r] = this[r].bind(this));
716-
c(t, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(t);
716+
c(e, this.options.supportTouch ? "touchstart" : "mousedown", this._onDrag), this.autoScroller = new T(this.options), this.multiplayer = new P(this.options), this.animator = new N(this.options), tt.push(e);
717717
}
718718
return ot.prototype = {
719719
constructor: ot,
@@ -730,7 +730,7 @@
730730
clientY: (n || t).clientY
731731
}, k = i, c(Q = n ? k : document, "mouseup", this._onDrop), c(Q, "touchend", this._onDrop), c(Q, "touchcancel", this._onDrop), !this.multiplayer.useSelectHandle(t, o))) {
732732
var a = this.options.handle;
733-
if (("function" != typeof a || a(t)) && ("string" != typeof a || b(o, a))) {
733+
if (("function" != typeof a || a(t)) && ("string" != typeof a || p(o, a, k))) {
734734
var h = this.options,
735735
u = h.delay,
736736
d = h.delayOnTouchOnly;
@@ -785,17 +785,18 @@
785785
},
786786
_appendGhost: function () {
787787
if (!B) {
788-
var t = this.options.fallbackOnBody ? document.body : this.el,
788+
var e = this.options.fallbackOnBody ? document.body : this.el,
789789
n = this._getGhostElement();
790790
w(B = n.cloneNode(!0), this.options.ghostClass, !0);
791791
var o = d(k),
792-
i = e({
792+
i = t({
793793
position: "fixed",
794794
top: o.top,
795795
left: o.left,
796796
width: o.width,
797797
height: o.height,
798-
zIndex: "100000",
798+
margin: 0,
799+
zIndex: 1e5,
799800
opacity: "0.8",
800801
overflow: "hidden",
801802
boxSizing: "border-box",
@@ -804,7 +805,7 @@
804805
pointerEvents: "none"
805806
}, this.options.ghostStyle);
806807
for (var r in i) S(B, r, i[r]);
807-
ot.ghost = B, t.appendChild(B);
808+
ot.ghost = B, e.appendChild(B);
808809
var s = (U.clientX - o.left) / parseInt(B.style.width) * 100,
809810
l = (U.clientY - o.top) / parseInt(B.style.height) * 100;
810811
S(B, "transform-origin", "".concat(s, "% ").concat(l, "%")), S(B, "will-change", "transform");
@@ -954,32 +955,32 @@
954955
evt: this._getEventProperties(t)
955956
}), F && this._onEnd(t), !F && this.animator.animate()), !nt(t.changedTouches ? t.changedTouches[0] : t) && this.multiplayer.onSelect(t, k, R, this), B && B.parentNode && B.parentNode.removeChild(B), this._nulling();
956957
},
957-
_onEnd: function (t) {
958+
_onEnd: function (e) {
958959
w(Y, this.options.chosenClass, !1), w(Y, this.options.placeholderClass, !1);
959960
var n = "clone" === z;
960961
this.multiplayer.onDrop(H, O, n);
961-
var o = this._getEventProperties(t),
962+
var o = this._getEventProperties(e),
962963
i = this.options,
963964
r = i.swapOnDrop,
964965
s = i.removeCloneOnDrop;
965966
n && H !== O || !("function" == typeof r ? r(o) : r) || A.insertBefore(k, Y), n && H !== O && !this.multiplayer.isActive() || !("function" == typeof s ? s(o) : s) || Y && Y.parentNode && Y.parentNode.removeChild(Y), S(k, "display", ""), this.animator.animate(), H !== O && C({
966967
sortable: H[M],
967968
name: "onDrop",
968-
evt: e({}, o, n ? J : {
969+
evt: t({}, o, n ? J : {
969970
newIndex: -1
970971
})
971972
}), C({
972973
sortable: O[M],
973974
name: "onDrop",
974-
evt: e({}, o, H === O ? {} : {
975+
evt: t({}, o, H === O ? {} : {
975976
oldIndex: -1
976977
})
977978
});
978979
},
979-
_getEventProperties: function (t) {
980+
_getEventProperties: function (e) {
980981
var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
981982
o = {};
982-
return o.event = t, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, e(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
983+
return o.event = e, o.to = O, o.from = H, o.node = k, o.clone = Y, o.target = W, o.oldIndex = V, o.newIndex = j, o.pullMode = z, t(o, this.multiplayer.eventProperties(), n), o.relative = W === k ? 0 : _(Y, W), o;
983984
},
984985
_nulling: function () {
985986
O = H = k = L = X = Y = B = R = W = A = z = V = j = G = U = F = q = J = K = Q = Z = $ = ot.clone = ot.ghost = ot.active = ot.dragged = null, this.multiplayer.nulling(), this.autoScroller.nulling();

dist/virtual-list.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-sortable",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A virtual scrolling list component that can be sorted by dragging",
55
"main": "dist/virtual-list.min.js",
66
"files": [
@@ -37,7 +37,7 @@
3737
},
3838
"homepage": "https://github.com/mfuu/vue-virtual-sortable#readme",
3939
"dependencies": {
40-
"sortable-dnd": "^0.6.22"
40+
"sortable-dnd": "^0.6.23"
4141
},
4242
"devDependencies": {
4343
"@babel/core": "^7.8.7",

0 commit comments

Comments
 (0)