react-resizable-box
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -63,7 +63,8 @@ 'use strict'; | ||
_this.onMouseUp = _this.onMouseUp.bind(_this); | ||
window.addEventListener('mouseup', _this.onMouseUp); | ||
window.addEventListener('mousemove', _this.onMouseMove); | ||
window.addEventListener('touchmove', _this.onTouchMove); | ||
window.addEventListener('touchend', _this.onMouseUp); | ||
if (typeof window !== 'undefined') { | ||
window.addEventListener('mouseup', _this.onMouseUp); | ||
window.addEventListener('mousemove', _this.onMouseMove); | ||
window.addEventListener('touchmove', _this.onTouchMove); | ||
window.addEventListener('touchend', _this.onMouseUp); | ||
} | ||
return _this; | ||
@@ -95,6 +96,8 @@ } | ||
value: function componentWillUnmount() { | ||
window.removeEventListener('mouseup', this.onMouseUp); | ||
window.removeEventListener('mousemove', this.onMouseMove); | ||
window.removeEventListener('touchmove', this.onTouchMove); | ||
window.removeEventListener('touchend', this.onMouseUp); | ||
if (typeof window !== 'undefined') { | ||
window.removeEventListener('mouseup', this.onMouseUp); | ||
window.removeEventListener('mousemove', this.onMouseMove); | ||
window.removeEventListener('touchmove', this.onTouchMove); | ||
window.removeEventListener('touchend', this.onMouseUp); | ||
} | ||
} | ||
@@ -229,5 +232,9 @@ }, { | ||
value: function getBoxSize() { | ||
var style = window.getComputedStyle(this.refs.resizable, null); | ||
var width = ~~style.getPropertyValue('width').replace('px', ''); | ||
var height = ~~style.getPropertyValue('height').replace('px', ''); | ||
var width = '0'; | ||
var height = '0'; | ||
if (typeof window !== 'undefined') { | ||
var style = window.getComputedStyle(this.refs.resizable, null); | ||
width = ~~style.getPropertyValue('width').replace('px', ''); | ||
height = ~~style.getPropertyValue('height').replace('px', ''); | ||
} | ||
return { width: width, height: height }; | ||
@@ -234,0 +241,0 @@ } |
{ | ||
"name": "react-resizable-box", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
22636
502