react-resizable-box
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -83,2 +83,7 @@ 'use strict'; | ||
height: 0 | ||
}, | ||
// offset is back door for rnd component | ||
offset: { | ||
x: 0, | ||
y: 0 | ||
} | ||
@@ -205,4 +210,4 @@ }; | ||
if (parent instanceof HTMLElement) { | ||
var boundWidth = parent.offsetWidth + (parent.offsetLeft - this.resizable.offsetLeft); | ||
var boundHeight = parent.offsetHeight + (parent.offsetTop - this.resizable.offsetTop); | ||
var boundWidth = parent.offsetWidth + (parent.offsetLeft - this.resizable.offsetLeft) - this.state.offset.x; | ||
var boundHeight = parent.offsetHeight + (parent.offsetTop - this.resizable.offsetTop) - this.state.offset.y; | ||
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth; | ||
@@ -213,4 +218,4 @@ maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight; | ||
if (typeof window !== 'undefined') { | ||
var _boundWidth = window.innerWidth - this.resizable.offsetLeft; | ||
var _boundHeight = window.innerHeight - this.resizable.offsetTop; | ||
var _boundWidth = window.innerWidth - this.resizable.offsetLeft - this.state.offset.x; | ||
var _boundHeight = window.innerHeight - this.resizable.offsetTop - this.state.offset.y; | ||
maxWidth = maxWidth && maxWidth < _boundWidth ? maxWidth : _boundWidth; | ||
@@ -220,4 +225,4 @@ maxHeight = maxHeight && maxHeight < _boundHeight ? maxHeight : _boundHeight; | ||
} else if (this.props.bounds && this.props.bounds instanceof HTMLElement) { | ||
var _boundWidth2 = this.props.bounds.offsetWidth + (this.props.bounds.offsetLeft - this.resizable.offsetLeft); | ||
var _boundHeight2 = this.props.bounds.offsetHeight + (this.props.bounds.offsetTop - this.resizable.offsetTop); | ||
var _boundWidth2 = this.props.bounds.offsetWidth + (this.props.bounds.offsetLeft - this.resizable.offsetLeft) - this.state.offset.x; | ||
var _boundHeight2 = this.props.bounds.offsetHeight + (this.props.bounds.offsetTop - this.resizable.offsetTop) - this.state.offset.y; | ||
maxWidth = maxWidth && maxWidth < _boundWidth2 ? maxWidth : _boundWidth2; | ||
@@ -224,0 +229,0 @@ maxHeight = maxHeight && maxHeight < _boundHeight2 ? maxHeight : _boundHeight2; |
{ | ||
"name": "react-resizable-box", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -218,2 +218,6 @@ # react-resizable-box | ||
#### v2.0.1 | ||
- Add offset state for rnd component. | ||
#### v2.0.0 | ||
@@ -220,0 +224,0 @@ |
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
33583
540
344