react-draggable
Advanced tools
Comparing version 0.7.0 to 0.7.1
{ | ||
"name": "react-draggable", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"homepage": "https://github.com/mzabriskie/react-draggable", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -70,1 +70,7 @@ # Changelog | ||
direction by that many pixels. | ||
### 0.7.1 (May 7, 2015) | ||
- The `start` param is back. Pass `{x: Number, y: Number}` to kickoff the CSS transform. Useful in certain | ||
cases for simpler callback math (so you don't have to know its existing relative position and add it to | ||
the dragged position). Fixes #52. |
@@ -368,2 +368,24 @@ 'use strict'; | ||
/** | ||
* `start` specifies the x and y that the dragged item should start at | ||
* | ||
* Example: | ||
* | ||
* ```jsx | ||
* var App = React.createClass({ | ||
* render: function () { | ||
* return ( | ||
* <Draggable start={{x: 25, y: 25}}> | ||
* <div>I start with transformX: 25px and transformY: 25px;</div> | ||
* </Draggable> | ||
* ); | ||
* } | ||
* }); | ||
* ``` | ||
*/ | ||
start: React.PropTypes.shape({ | ||
x: React.PropTypes.number, | ||
y: React.PropTypes.number | ||
}), | ||
/** | ||
* `zIndex` specifies the zIndex to use while dragging. | ||
@@ -470,2 +492,3 @@ * | ||
grid: null, | ||
start: {x: 0, y: 0}, | ||
zIndex: NaN, | ||
@@ -489,3 +512,3 @@ enableUserSelectHack: true, | ||
// Current transform x and y. | ||
clientX: 0, clientY: 0 | ||
clientX: this.props.start.x, clientY: this.props.start.y | ||
}; | ||
@@ -492,0 +515,0 @@ }, |
{ | ||
"name": "react-draggable", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "React draggable component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -83,2 +83,6 @@ # react-draggable [![Build Status](https://travis-ci.org/mzabriskie/react-draggable.svg?branch=master)](https://travis-ci.org/mzabriskie/react-draggable) | ||
// | ||
// `start` specifies the x and y that the dragged item should start at. This is generally not necessary | ||
// to use (you can use absolute or relative positioning of the child directly), but can be helpful | ||
// for uniformity in your callbacks and with css transforms. | ||
// | ||
// `zIndex` specifies the zIndex to use while dragging. | ||
@@ -85,0 +89,0 @@ // |
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
29439
601
135