提交 807a8704 编写于 作者: D Dario Cantatore

added slideFactorX and slideFactorY

上级 a7062a3e
......@@ -4,3 +4,4 @@ npm-debug.log
Thumbs.db
package-lock.json
.idea/*
test/test.html
此差异已折叠。
此差异已折叠。
......@@ -123,10 +123,13 @@ function dragula (initialContainers, options) {
release({});
return; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope
}
// truthy check fixes #239, equality fixes #207
if (e.clientX !== void 0 && e.clientX === _moveX && e.clientY !== void 0 && e.clientY === _moveY) {
// truthy check fixes #239, equality fixes #207, fixes #501
if ((e.clientX !== void 0 && Math.abs(e.clientX - _moveX) <= (o.slideFactorX || 0)) &&
(e.clientY !== void 0 && Math.abs(e.clientY - _moveY) <= (o.slideFactorY || 0))) {
return;
}
if (o.ignoreInputTextSelection) {
var clientX = getCoord('clientX', e) || 0;
var clientY = getCoord('clientY', e) || 0;
......
......@@ -42,12 +42,6 @@ You can get it on npm.
npm install dragula --save
```
Or bower, too.
```shell
bower install dragula --save
```
Or a CDN.
```shell
......@@ -110,7 +104,9 @@ dragula(containers, {
revertOnSpill: false, // spilling will put the element back where it was dragged from, if this is true
removeOnSpill: false, // spilling will `.remove` the element, if this is true
mirrorContainer: document.body, // set the element that gets mirror elements appended
ignoreInputTextSelection: true // allows users to select input text, see details below
ignoreInputTextSelection: true, // allows users to select input text, see details below
slideFactorX: 0, // allows users to select the amount of movement on the X axis before it is considered a drag instead of a click
slideFactorY: 0, // allows users to select the amount of movement on the Y axis before it is considered a drag instead of a click
});
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册