react-grid-layout
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -126,2 +126,6 @@ 'use strict'; | ||
mixinResizable(child, position) { | ||
var p = this.props; | ||
var colWidth = p.containerWidth / p.cols - p.margin[0]; | ||
var maxWidth = (colWidth + p.margin[0]) * (p.cols - p.x) - p.margin[0] * 2; | ||
var rowHeight = p.rowHeight - p.margin[1]; | ||
return ( | ||
@@ -131,2 +135,4 @@ <Resizable | ||
height={position.height} | ||
minConstraints={[colWidth, rowHeight]} | ||
maxConstraints={[maxWidth, Infinity]} | ||
onResizeStop={this.onResizeHandler('onResizeStop')} | ||
@@ -157,5 +163,3 @@ onResizeStart={this.onResizeHandler('onResizeStart')} | ||
// Cap x at numCols | ||
if (x + me.props.w > me.props.cols) { | ||
x = me.props.cols - me.props.w; | ||
} | ||
x = Math.min(x, me.props.cols - me.props.w); | ||
@@ -183,5 +187,5 @@ me.props[handlerName](me.props.i, x, y); | ||
// Cap w at numCols | ||
if (w + me.props.x > me.props.cols) { | ||
w = me.props.cols - me.props.x; | ||
} | ||
w = Math.min(w, me.props.cols - me.props.x); | ||
// Ensure w is at least 1 | ||
w = Math.max(w, 1); | ||
@@ -188,0 +192,0 @@ me.setState({resizing: handlerName === 'onResizeStop' ? null : size}); |
{ | ||
"name": "react-grid-layout", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A draggable and resizable grid layout with responsive breakpoints, for React.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,4 +21,5 @@ ### React-Grid-Layout | ||
[1. Basic](https://strml.github.io/react-grid-layout/examples/1-basic.html) | ||
[1. No Dragging/Resizing (Layout Only)](https://strml.github.io/react-grid-layout/examples/2-no-dragging.html) | ||
1. [Basic](https://strml.github.io/react-grid-layout/examples/1-basic.html) | ||
1. [No Dragging/Resizing (Layout Only)](https://strml.github.io/react-grid-layout/examples/2-no-dragging.html) | ||
1. [Messy Layout Autocorrect](https://strml.github.io/react-grid-layout/examples/3-messy.html) | ||
@@ -25,0 +26,0 @@ ---- |
@@ -44,3 +44,2 @@ 'use strict'; | ||
onLayoutChange: function(layout) { | ||
console.log(layout); | ||
this.setState({layout: layout}); | ||
@@ -47,0 +46,0 @@ }, |
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
30572
18
762
36