Skip to content

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TahaSh committed Dec 20, 2024
1 parent e211f2c commit efe4319
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/swapy.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,15 @@ function mt(t, e, n, o) {
return requestAnimationFrame(a), i;
}
const Tt = {
startDelay: 0
startDelay: 0,
targetEl: null
};
function Mt(t, e) {
const n = { ...Tt, ...e };
let o = t.el(), l = !1, i = null, d = null, u = null, a = null, h = 0, s = 0, c = 0, f = 0, y = 0, v = 0, g = 0, T = 0, r = 0, A = 0, E = null, p;
o.addEventListener("pointerdown", w), document.body.addEventListener("pointerup", x), document.body.addEventListener("pointermove", X), document.body.addEventListener("touchmove", M, { passive: !1 });
function w(m) {
if (l || !m.isPrimary) return;
if (n.targetEl && m.target !== n.targetEl || l || !m.isPrimary) return;
n.startDelay > 0 ? (u == null || u({ el: m.target }), p = setTimeout(() => {
B();
}, n.startDelay)) : B();
Expand Down Expand Up @@ -822,7 +823,8 @@ function Pt(t, e) {
}, y = () => {
};
const { onDrag: v, onDrop: g, onHold: T, onRelease: r } = n.usePlugin(Mt, {
startDelay: e.config().dragOnHold ? 400 : 0
startDelay: e.config().dragOnHold ? 400 : 0,
targetEl: P()
}), A = R(0, 0), E = R(0, 0), p = R(0, 0), w = R(0, 0);
let I = null, x = null;
T((S) => {
Expand Down
Loading

0 comments on commit efe4319

Please sign in to comment.