react-dnd-touch-backend
Advanced tools
Comparing version 0.2.4 to 0.2.5
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.reactDndTouchBackend = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function (process){ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @providesModule invariant | ||
*/ | ||
'use strict'; | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
var invariant = function(condition, format, a, b, c, d, e, f) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (format === undefined) { | ||
throw new Error('invariant requires an error message argument'); | ||
} | ||
} | ||
if (!condition) { | ||
var error; | ||
if (format === undefined) { | ||
error = new Error( | ||
'Minified exception occurred; use the non-minified dev environment ' + | ||
'for the full error message and additional helpful warnings.' | ||
); | ||
} else { | ||
var args = [a, b, c, d, e, f]; | ||
var argIndex = 0; | ||
error = new Error( | ||
'Invariant Violation: ' + | ||
format.replace(/%s/g, function() { return args[argIndex++]; }) | ||
); | ||
} | ||
error.framesToPop = 1; // we don't care about invariant's own frame | ||
throw error; | ||
} | ||
}; | ||
module.exports = invariant; | ||
}).call(this,require('_process')) | ||
},{"_process":2}],2:[function(require,module,exports){ | ||
// shim for using process in browser | ||
@@ -152,4 +94,60 @@ | ||
},{}],3:[function(require,module,exports){ | ||
},{}],2:[function(require,module,exports){ | ||
(function (process){ | ||
/** | ||
* Copyright 2013-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
*/ | ||
'use strict'; | ||
/** | ||
* Use invariant() to assert state which your program assumes to be true. | ||
* | ||
* Provide sprintf-style format (only %s is supported) and arguments | ||
* to provide information about what broke and what you were | ||
* expecting. | ||
* | ||
* The invariant message will be stripped in production, but the invariant | ||
* will remain to ensure logic does not differ in production. | ||
*/ | ||
var invariant = function(condition, format, a, b, c, d, e, f) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (format === undefined) { | ||
throw new Error('invariant requires an error message argument'); | ||
} | ||
} | ||
if (!condition) { | ||
var error; | ||
if (format === undefined) { | ||
error = new Error( | ||
'Minified exception occurred; use the non-minified dev environment ' + | ||
'for the full error message and additional helpful warnings.' | ||
); | ||
} else { | ||
var args = [a, b, c, d, e, f]; | ||
var argIndex = 0; | ||
error = new Error( | ||
format.replace(/%s/g, function() { return args[argIndex++]; }) | ||
); | ||
error.name = 'Invariant Violation'; | ||
} | ||
error.framesToPop = 1; // we don't care about invariant's own frame | ||
throw error; | ||
} | ||
}; | ||
module.exports = invariant; | ||
}).call(this,require('_process')) | ||
},{"_process":1}],3:[function(require,module,exports){ | ||
/** | ||
* Copyright 2015, Yahoo Inc. | ||
@@ -160,16 +158,13 @@ * Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms. | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.TouchBackend = undefined; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
exports['default'] = createTouchBackend; | ||
exports.default = createTouchBackend; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _invariant = require('invariant'); | ||
@@ -179,2 +174,6 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function getEventClientTouchOffset(e) { | ||
@@ -205,6 +204,6 @@ if (e.targetTouches.length === 1) { | ||
var _el$getBoundingClientRect = el.getBoundingClientRect(); | ||
var _el$getBoundingClient = el.getBoundingClientRect(); | ||
var top = _el$getBoundingClientRect.top; | ||
var left = _el$getBoundingClientRect.left; | ||
var top = _el$getBoundingClient.top; | ||
var left = _el$getBoundingClient.left; | ||
@@ -227,3 +226,3 @@ return { x: left, y: top }; | ||
var TouchBackend = (function () { | ||
var TouchBackend = exports.TouchBackend = function () { | ||
function TouchBackend(manager) { | ||
@@ -236,3 +235,4 @@ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
enableTouchEvents: true, | ||
enableMouseEvents: false | ||
enableMouseEvents: false, | ||
delay: 0 | ||
}, options); | ||
@@ -244,2 +244,3 @@ | ||
this.delay = options.delay; | ||
this.sourceNodes = {}; | ||
@@ -264,2 +265,3 @@ this.sourceNodeOptions = {}; | ||
this.handleTopMoveStart = this.handleTopMoveStart.bind(this); | ||
this.handleTopMoveStartDelay = this.handleTopMoveStartDelay.bind(this); | ||
this.handleTopMoveStartCapture = this.handleTopMoveStartCapture.bind(this); | ||
@@ -277,7 +279,9 @@ this.handleTopMoveCapture = this.handleTopMoveCapture.bind(this); | ||
(0, _invariant2['default'])(!this.constructor.isSetUp, 'Cannot have two Touch backends at the same time.'); | ||
(0, _invariant2.default)(!this.constructor.isSetUp, 'Cannot have two Touch backends at the same time.'); | ||
this.constructor.isSetUp = true; | ||
var startHandler = this.delay ? this.handleTopMoveStartDelay : this.handleTopMoveStart; | ||
this.addEventListener(window, 'start', startHandler); | ||
this.addEventListener(window, 'start', this.handleTopMoveStartCapture, true); | ||
this.addEventListener(window, 'start', this.handleTopMoveStart); | ||
this.addEventListener(window, 'move', this.handleTopMoveCapture, true); | ||
@@ -385,2 +389,7 @@ this.addEventListener(window, 'end', this.handleTopMoveEndCapture, true); | ||
}, { | ||
key: 'handleTopMoveStartDelay', | ||
value: function handleTopMoveStartDelay(e) { | ||
this.timeout = setTimeout(this.handleTopMoveStart.bind(this, e), this.delay); | ||
} | ||
}, { | ||
key: 'handleTopMoveCapture', | ||
@@ -390,2 +399,4 @@ value: function handleTopMoveCapture(e) { | ||
clearTimeout(this.timeout); | ||
var moveStartSourceIds = this.moveStartSourceIds; | ||
@@ -485,6 +496,4 @@ | ||
return TouchBackend; | ||
})(); | ||
}(); | ||
exports.TouchBackend = TouchBackend; | ||
function createTouchBackend() { | ||
@@ -504,4 +513,4 @@ var optionsOrManager = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
},{"invariant":1}]},{},[3])(3) | ||
},{"invariant":2}]},{},[3])(3) | ||
}); | ||
//# sourceMappingURL=data:application/json;charset:utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvaW52YXJpYW50L2Jyb3dzZXIuanMiLCJub2RlX21vZHVsZXMvcHJvY2Vzcy9icm93c2VyLmpzIiwiL1VzZXJzL2xvbmdoby9Xb3JrL3JlYWN0LWRuZC10b3VjaC1iYWNrZW5kL3NyYy9Ub3VjaC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7QUNyREE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0F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AgICB0aGlzLm1vdmVTdGFydFNvdXJjZUlkcyA9IG51bGw7XG4gICAgICAgICAgICB0aGlzLmFjdGlvbnMuYmVnaW5EcmFnKG1vdmVTdGFydFNvdXJjZUlkcywge1xuICAgICAgICAgICAgICAgIGNsaWVudE9mZnNldDogdGhpcy5fbW91c2VDbGllbnRPZmZzZXQsXG4gICAgICAgICAgICAgICAgZ2V0U291cmNlQ2xpZW50T2Zmc2V0OiB0aGlzLmdldFNvdXJjZUNsaWVudE9mZnNldCxcbiAgICAgICAgICAgICAgICBwdWJsaXNoU291cmNlOiBmYWxzZVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMubW9uaXRvci5pc0RyYWdnaW5nKCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHNvdXJjZU5vZGUgPSB0aGlzLnNvdXJjZU5vZGVzW3RoaXMubW9uaXRvci5nZXRTb3VyY2VJZCgpXTtcbiAgICAgICAgdGhpcy5pbnN0YWxsU291cmNlTm9kZVJlbW92YWxPYnNlcnZlcihzb3VyY2VOb2RlKTtcbiAgICAgICAgdGhpcy5hY3Rpb25zLnB1Ymxpc2hEcmFnU291cmNlKCk7XG5cbiAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuXG4gICAgICAgIGNvbnN0IG1hdGNoaW5nVGFyZ2V0SWRzID0gT2JqZWN0LmtleXModGhpcy50YXJnZXROb2RlcylcbiAgICAgICAgICAgIC5maWx0ZXIoKHRhcmdldElkKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgYm91bmRpbmdSZWN0ID0gdGhpcy50YXJnZXROb2Rlc1t0YXJnZXRJZF0uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsaWVudE9mZnNldC54ID49IGJvdW5kaW5nUmVjdC5sZWZ0ICYmXG4gICAgICAgICAgICAgICAgY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ICAgICB9XG5cbiAgICAgICAgdGhpcy5kcmFnZ2VkU291cmNlTm9kZVJlbW92YWxPYnNlcnZlciA9IG51bGw7XG4gICAgICAgIHRoaXMuZHJhZ2dlZFNvdXJjZU5vZGUgPSBudWxsO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gY3JlYXRlVG91Y2hCYWNrZW5kIChvcHRpb25zT3JNYW5hZ2VyID0ge30pIHtcbiAgICBjb25zdCB0b3VjaEJhY2tlbmRGYWN0b3J5ID0gZnVuY3Rpb24gKG1hbmFnZXIpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBUb3VjaEJhY2tlbmQobWFuYWdlciwgb3B0aW9uc09yTWFuYWdlcik7XG4gICAgfTtcblxuICAgIGlmIChvcHRpb25zT3JNYW5hZ2VyLmdldE1vbml0b3IpIHtcbiAgICAgICAgcmV0dXJuIHRvdWNoQmFja2VuZEZhY3Rvcnkob3B0aW9uc09yTWFuYWdlcik7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIHRvdWNoQmFja2VuZEZhY3Rvcnk7XG4gICAgfVxufVxuIl19 |
@@ -7,16 +7,13 @@ /** | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.TouchBackend = undefined; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
exports['default'] = createTouchBackend; | ||
exports.default = createTouchBackend; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _invariant = require('invariant'); | ||
@@ -26,2 +23,6 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function getEventClientTouchOffset(e) { | ||
@@ -52,6 +53,6 @@ if (e.targetTouches.length === 1) { | ||
var _el$getBoundingClientRect = el.getBoundingClientRect(); | ||
var _el$getBoundingClient = el.getBoundingClientRect(); | ||
var top = _el$getBoundingClientRect.top; | ||
var left = _el$getBoundingClientRect.left; | ||
var top = _el$getBoundingClient.top; | ||
var left = _el$getBoundingClient.left; | ||
@@ -74,3 +75,3 @@ return { x: left, y: top }; | ||
var TouchBackend = (function () { | ||
var TouchBackend = exports.TouchBackend = function () { | ||
function TouchBackend(manager) { | ||
@@ -83,3 +84,4 @@ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
enableTouchEvents: true, | ||
enableMouseEvents: false | ||
enableMouseEvents: false, | ||
delay: 0 | ||
}, options); | ||
@@ -91,2 +93,3 @@ | ||
this.delay = options.delay; | ||
this.sourceNodes = {}; | ||
@@ -111,2 +114,3 @@ this.sourceNodeOptions = {}; | ||
this.handleTopMoveStart = this.handleTopMoveStart.bind(this); | ||
this.handleTopMoveStartDelay = this.handleTopMoveStartDelay.bind(this); | ||
this.handleTopMoveStartCapture = this.handleTopMoveStartCapture.bind(this); | ||
@@ -124,7 +128,9 @@ this.handleTopMoveCapture = this.handleTopMoveCapture.bind(this); | ||
(0, _invariant2['default'])(!this.constructor.isSetUp, 'Cannot have two Touch backends at the same time.'); | ||
(0, _invariant2.default)(!this.constructor.isSetUp, 'Cannot have two Touch backends at the same time.'); | ||
this.constructor.isSetUp = true; | ||
var startHandler = this.delay ? this.handleTopMoveStartDelay : this.handleTopMoveStart; | ||
this.addEventListener(window, 'start', startHandler); | ||
this.addEventListener(window, 'start', this.handleTopMoveStartCapture, true); | ||
this.addEventListener(window, 'start', this.handleTopMoveStart); | ||
this.addEventListener(window, 'move', this.handleTopMoveCapture, true); | ||
@@ -232,2 +238,7 @@ this.addEventListener(window, 'end', this.handleTopMoveEndCapture, true); | ||
}, { | ||
key: 'handleTopMoveStartDelay', | ||
value: function handleTopMoveStartDelay(e) { | ||
this.timeout = setTimeout(this.handleTopMoveStart.bind(this, e), this.delay); | ||
} | ||
}, { | ||
key: 'handleTopMoveCapture', | ||
@@ -237,2 +248,4 @@ value: function handleTopMoveCapture(e) { | ||
clearTimeout(this.timeout); | ||
var moveStartSourceIds = this.moveStartSourceIds; | ||
@@ -332,6 +345,4 @@ | ||
return TouchBackend; | ||
})(); | ||
}(); | ||
exports.TouchBackend = TouchBackend; | ||
function createTouchBackend() { | ||
@@ -338,0 +349,0 @@ var optionsOrManager = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; |
{ | ||
"name": "react-dnd-touch-backend", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Touch backend for react-dnd", | ||
"main": "dist/Touch.js", | ||
"scripts": { | ||
"lint": "eslint --quiet --cache . --ext .js --ext .jsx", | ||
"prepublish": "gulp dist", | ||
@@ -32,12 +33,15 @@ "test": "gulp clean lint" | ||
"devDependencies": { | ||
"babel": "^5.8.23", | ||
"babel-eslint": "^4.1.3", | ||
"babelify": "^6.3.0", | ||
"browserify": "^11.2.0", | ||
"babel-core": "^6.5.0", | ||
"babel-eslint": "^5.0.0", | ||
"babel-preset-es2015": "^6.3.13", | ||
"babel-preset-react": "^6.3.13", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"babelify": "^7.2.0", | ||
"browserify": "^13.0.0", | ||
"classnames": "^2.1.5", | ||
"del": "^2.0.2", | ||
"eslint-plugin-react": "^3.5.1", | ||
"eslint": "^2.4.0", | ||
"eslint-plugin-react": "^4.2.3", | ||
"gulp": "^3.9.0", | ||
"gulp-babel": "^5.2.1", | ||
"gulp-eslint": "^1.0.0", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-util": "^3.0.6", | ||
@@ -44,0 +48,0 @@ "immutable": "^3.7.5", |
@@ -39,3 +39,3 @@ <img src="https://avatars2.githubusercontent.com/u/6412038?v=3&s=200" alt="react logo" title="react" align="right" width="64" height="64" /> | ||
```bash | ||
npm i && gulp example | ||
npm i && gulp js-dev | ||
``` | ||
@@ -42,0 +42,0 @@ Then, open `examples/index.html` in a mobile browser. |
@@ -58,2 +58,3 @@ /** | ||
enableMouseEvents: false, | ||
delay: 0, | ||
...options | ||
@@ -66,2 +67,3 @@ }; | ||
this.delay = options.delay; | ||
this.sourceNodes = {}; | ||
@@ -86,2 +88,3 @@ this.sourceNodeOptions = {}; | ||
this.handleTopMoveStart = this.handleTopMoveStart.bind(this); | ||
this.handleTopMoveStartDelay = this.handleTopMoveStartDelay.bind(this); | ||
this.handleTopMoveStartCapture = this.handleTopMoveStartCapture.bind(this); | ||
@@ -100,4 +103,8 @@ this.handleTopMoveCapture = this.handleTopMoveCapture.bind(this); | ||
var startHandler = this.delay | ||
? this.handleTopMoveStartDelay | ||
: this.handleTopMoveStart; | ||
this.addEventListener(window, 'start', startHandler); | ||
this.addEventListener(window, 'start', this.handleTopMoveStartCapture, true); | ||
this.addEventListener(window, 'start', this.handleTopMoveStart); | ||
this.addEventListener(window, 'move', this.handleTopMoveCapture, true); | ||
@@ -189,3 +196,9 @@ this.addEventListener(window, 'end', this.handleTopMoveEndCapture, true); | ||
handleTopMoveStartDelay (e) { | ||
this.timeout = setTimeout(this.handleTopMoveStart.bind(this, e), this.delay); | ||
} | ||
handleTopMoveCapture (e) { | ||
clearTimeout(this.timeout); | ||
const { moveStartSourceIds } = this; | ||
@@ -192,0 +205,0 @@ const clientOffset = getEventClientOffset(e); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90168
13
1079
20