Skip to content

Commit 611c895

Browse files
committed
Many fixes for 0.5.0 release. See below.
Fixes: * #48 (draggable start at current position), * #34 (move element from javascript), * #46 (spaces to tabs), * Parts of #31 ('moveOnStartChange', add node to drag callbacks, fix pendingState in drag callbacks) * Linting errors * Documentation
1 parent 80ce610 commit 611c895

File tree

6 files changed

+428
-372
lines changed

6 files changed

+428
-372
lines changed

README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ var App = React.createClass({
4646
// to whatever element is supplied as `this.props.children`.
4747
// Only a single element is allowed or an Error will be thrown.
4848
//
49+
// The element is moved from its current position using absolute positioning.
50+
//
4951
// `axis` determines which axis the draggable can move.
5052
// - 'both' allows movement horizontally and vertically (default).
5153
// - 'x' limits movement to horizontal axis.
@@ -57,8 +59,6 @@ var App = React.createClass({
5759
//
5860
// `grid` specifies the x and y that dragging should snap to.
5961
//
60-
// `start` specifies the x and y that the dragged item should start at
61-
//
6262
// `zIndex` specifies the zIndex to use while dragging.
6363
//
6464
// `onStart` is called when dragging starts.
@@ -71,7 +71,6 @@ var App = React.createClass({
7171
axis="x"
7272
handle=".handle"
7373
grid={[25, 25]}
74-
start={{x: 25, y: 25}}
7574
zIndex={100}
7675
onStart={this.handleStart}
7776
onDrag={this.handleDrag}
@@ -91,14 +90,29 @@ React.renderComponent(<App/>, document.body);
9190
## Contributing
9291

9392
- Fork the project
94-
- `$ npm install && npm start`
95-
- Make changes, webpack will watch and rebuild as you make changes
93+
- `$ npm install`
94+
- Make changes.
95+
- Run a static server in this folder to see your changes.
96+
For example: `$ npm install -g static-server; static-server .` and open
97+
http://localhost:9080/example.index.html
98+
- Run webpack in development mode to recompile changes as you make them:
99+
`$ npm run dev`
96100
- Add appropriate tests
97101
- `$ npm test`
98102
- If tests don't pass, make them pass.
99103
- Update README with appropriate docs.
104+
- Don't include `/dist` changes. These files are updated per-release.
100105
- Commit and PR
101106

107+
## Release checklist
108+
109+
- Update CHANGELOG
110+
- Update version in `bower.json`
111+
- Update version in `package.json`
112+
- Run build: `$ npm run build`
113+
- Commit, tag, push
114+
- `npm publish`
115+
102116
## License
103117

104118
MIT

example/index.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<head>
44
<meta charset="utf-8"/>
55
<title>React Draggable</title>
6-
<link rel="stylesheet" type="text/css" href="../lib/styles.css"/>
76
<style type="text/css">
87
body {
98
color: #222;
@@ -50,7 +49,7 @@
5049
<body>
5150
<script src="//fb.me/react-with-addons-0.13.2.js"></script>
5251
<script src="//fb.me/JSXTransformer-0.13.2.js"></script>
53-
<script src="../dist/react-draggable.min.js"></script>
52+
<script src="../dist/react-draggable.js"></script>
5453
<script type="text/jsx">
5554
var Draggable = ReactDraggable;
5655
var App = React.createClass({
@@ -108,6 +107,16 @@ <h1>React Draggable</h1>
108107
<Draggable grid={[50, 50]}>
109108
<div className="box">I snap to a 50 x 50 grid</div>
110109
</Draggable>
110+
<Draggable>
111+
<div className="box" style={{position: 'absolute', top: '400px', left: '700px'}}>
112+
I already have left and top properties assigned.
113+
</div>
114+
</Draggable>
115+
<Draggable>
116+
<div className="box" style={{position: 'absolute', bottom: '100px', right: '100px'}}>
117+
I already have bottom and right properties assigned.
118+
</div>
119+
</Draggable>
111120
</div>
112121
);
113122
}

0 commit comments

Comments
 (0)