react-dnd-touch-backend
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -44,3 +44,3 @@ /** | ||
var supportsPassive = function () { | ||
//simular to jQuery's test | ||
// simular to jQuery's test | ||
var supported = false; | ||
@@ -76,3 +76,4 @@ try { | ||
move: 'mousemove', | ||
end: 'mouseup' | ||
end: 'mouseup', | ||
contextmenu: 'contextmenu' | ||
}, | ||
@@ -110,2 +111,3 @@ touch: { | ||
this.enableKeyboardEvents = options.enableKeyboardEvents; | ||
this.enableMouseEvents = options.enableMouseEvents; | ||
this.delayTouchStart = options.delayTouchStart; | ||
@@ -159,2 +161,6 @@ this.delayMouseStart = options.delayMouseStart; | ||
if (this.enableMouseEvents) { | ||
this.addEventListener(window, 'contextmenu', this.handleTopMoveEndCapture); | ||
} | ||
if (this.enableKeyboardEvents) { | ||
@@ -180,2 +186,6 @@ this.addEventListener(window, 'keydown', this.handleCancelOnEscape, true); | ||
if (this.enableMouseEvents) { | ||
this.removeEventListener(window, 'contextmenu', this.handleTopMoveEndCapture); | ||
} | ||
if (this.enableKeyboardEvents) { | ||
@@ -396,3 +406,3 @@ this.removeEventListener(window, 'keydown', this.handleCancelOnEscape, true); | ||
value: function handleCancelOnEscape(e) { | ||
if (e.key === "Escape") { | ||
if (e.key === 'Escape') { | ||
this._mouseClientOffset = {}; | ||
@@ -405,2 +415,7 @@ | ||
}, { | ||
key: 'handleOnContextMenu', | ||
value: function handleOnContextMenu() { | ||
this.moveStartSourceIds = null; | ||
} | ||
}, { | ||
key: 'installSourceNodeRemovalObserver', | ||
@@ -407,0 +422,0 @@ value: function installSourceNodeRemovalObserver(node) { |
{ | ||
"name": "react-dnd-touch-backend", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "Touch backend for react-dnd", | ||
@@ -5,0 +5,0 @@ "main": "dist/Touch.js", |
@@ -27,3 +27,3 @@ /** | ||
const supportsPassive = (() => { | ||
//simular to jQuery's test | ||
// simular to jQuery's test | ||
let supported = false; | ||
@@ -55,3 +55,4 @@ try { | ||
move: 'mousemove', | ||
end: 'mouseup' | ||
end: 'mouseup', | ||
contextmenu: 'contextmenu' | ||
}, | ||
@@ -64,3 +65,3 @@ touch: { | ||
keyboard: { | ||
keydown: 'keydown', | ||
keydown: 'keydown' | ||
} | ||
@@ -87,2 +88,3 @@ }; | ||
this.enableKeyboardEvents = options.enableKeyboardEvents; | ||
this.enableMouseEvents = options.enableMouseEvents; | ||
this.delayTouchStart = options.delayTouchStart; | ||
@@ -134,2 +136,6 @@ this.delayMouseStart = options.delayMouseStart; | ||
if (this.enableMouseEvents) { | ||
this.addEventListener(window, 'contextmenu', this.handleTopMoveEndCapture); | ||
} | ||
if (this.enableKeyboardEvents){ | ||
@@ -154,2 +160,6 @@ this.addEventListener(window, 'keydown', this.handleCancelOnEscape, true); | ||
if (this.enableMouseEvents) { | ||
this.removeEventListener(window, 'contextmenu', this.handleTopMoveEndCapture); | ||
} | ||
if (this.enableKeyboardEvents){ | ||
@@ -358,10 +368,14 @@ this.removeEventListener(window, 'keydown', this.handleCancelOnEscape, true); | ||
handleCancelOnEscape (e) { | ||
if (e.key === "Escape"){ | ||
if (e.key === 'Escape'){ | ||
this._mouseClientOffset = {}; | ||
this.uninstallSourceNodeRemovalObserver(); | ||
this.actions.endDrag(); | ||
this.actions.endDrag(); | ||
} | ||
} | ||
handleOnContextMenu () { | ||
this.moveStartSourceIds = null; | ||
} | ||
installSourceNodeRemovalObserver (node) { | ||
@@ -368,0 +382,0 @@ this.uninstallSourceNodeRemovalObserver(); |
Sorry, the diff of this file is too big to display
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
106432
1509