react-modal-image
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -50,6 +50,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
return { x: x, y: y }; | ||
}, _this.handleMouseDown = function (event) { | ||
}, _this.handleMouseDownOrTouchStart = function (event) { | ||
event.preventDefault(); | ||
var coords = _this.getCoordinatesIfOverImg(event); | ||
var coords = _this.getCoordinatesIfOverImg(event.changedTouches ? event.changedTouches[event.changedTouches.length - 1] : event); | ||
@@ -69,6 +69,6 @@ if (!coords) { | ||
}); | ||
}, _this.handleMouseMove = function (event) { | ||
}, _this.handleMouseMoveOrTouchMove = function (event) { | ||
event.preventDefault(); | ||
var coords = _this.getCoordinatesIfOverImg(event); | ||
var coords = _this.getCoordinatesIfOverImg(event.changedTouches ? event.changedTouches[event.changedTouches.length - 1] : event); | ||
@@ -91,3 +91,3 @@ if (!coords) { | ||
}); | ||
}, _this.handleMouseUp = function (event) { | ||
}, _this.handleMouseUpOrTouchEnd = function (event) { | ||
_this.setState({ | ||
@@ -143,5 +143,8 @@ moveStart: undefined | ||
{ | ||
onMouseDown: this.handleMouseDown, | ||
onMouseUp: this.handleMouseUp, | ||
onMouseMove: this.handleMouseMove, | ||
onMouseDown: this.handleMouseDownOrTouchStart, | ||
onMouseUp: this.handleMouseUpOrTouchEnd, | ||
onMouseMove: this.handleMouseMoveOrTouchMove, | ||
onTouchStart: this.handleMouseDownOrTouchStart, | ||
onTouchEnd: this.handleMouseUpOrTouchEnd, | ||
onTouchMove: this.handleMouseMoveOrTouchMove, | ||
ref: function ref(el) { | ||
@@ -148,0 +151,0 @@ _this2.contentEl = el; |
@@ -9,3 +9,4 @@ export var modalStyles = { | ||
overflow: "auto", | ||
backgroundColor: "rgba(0, 0, 0, 0.8)" | ||
backgroundColor: "rgba(0, 0, 0, 0.8)", | ||
touchAction: "none" | ||
}; | ||
@@ -12,0 +13,0 @@ |
@@ -59,6 +59,6 @@ "use strict"; | ||
return { x: x, y: y }; | ||
}, _this.handleMouseDown = function (event) { | ||
}, _this.handleMouseDownOrTouchStart = function (event) { | ||
event.preventDefault(); | ||
var coords = _this.getCoordinatesIfOverImg(event); | ||
var coords = _this.getCoordinatesIfOverImg(event.changedTouches ? event.changedTouches[event.changedTouches.length - 1] : event); | ||
@@ -78,6 +78,6 @@ if (!coords) { | ||
}); | ||
}, _this.handleMouseMove = function (event) { | ||
}, _this.handleMouseMoveOrTouchMove = function (event) { | ||
event.preventDefault(); | ||
var coords = _this.getCoordinatesIfOverImg(event); | ||
var coords = _this.getCoordinatesIfOverImg(event.changedTouches ? event.changedTouches[event.changedTouches.length - 1] : event); | ||
@@ -100,3 +100,3 @@ if (!coords) { | ||
}); | ||
}, _this.handleMouseUp = function (event) { | ||
}, _this.handleMouseUpOrTouchEnd = function (event) { | ||
_this.setState({ | ||
@@ -152,5 +152,8 @@ moveStart: undefined | ||
{ | ||
onMouseDown: this.handleMouseDown, | ||
onMouseUp: this.handleMouseUp, | ||
onMouseMove: this.handleMouseMove, | ||
onMouseDown: this.handleMouseDownOrTouchStart, | ||
onMouseUp: this.handleMouseUpOrTouchEnd, | ||
onMouseMove: this.handleMouseMoveOrTouchMove, | ||
onTouchStart: this.handleMouseDownOrTouchStart, | ||
onTouchEnd: this.handleMouseUpOrTouchEnd, | ||
onTouchMove: this.handleMouseMoveOrTouchMove, | ||
ref: function ref(el) { | ||
@@ -157,0 +160,0 @@ _this2.contentEl = el; |
@@ -12,3 +12,4 @@ "use strict"; | ||
overflow: "auto", | ||
backgroundColor: "rgba(0, 0, 0, 0.8)" | ||
backgroundColor: "rgba(0, 0, 0, 0.8)", | ||
touchAction: "none" | ||
}; | ||
@@ -15,0 +16,0 @@ |
{ | ||
"name": "react-modal-image", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Lightweight Lightbox React Component", | ||
"main": "lib/index.js", | ||
"module": "es/index.js", | ||
"files": [ | ||
"es", | ||
"lib" | ||
], | ||
"files": ["es", "lib"], | ||
"scripts": { | ||
@@ -36,9 +33,3 @@ "build": "nwb build-react-component", | ||
"license": "MIT", | ||
"keywords": [ | ||
"react-component", | ||
"lightbox", | ||
"modal", | ||
"image", | ||
"react" | ||
] | ||
"keywords": ["react-component", "lightbox", "modal", "image", "react"] | ||
} |
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
31321
751