Skip to content

Commit c9555bd

Browse files
committed
Merge pull request #25 from ZillDing/master
Master
2 parents 1892234 + 051841d commit c9555bd

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

examples/1.html

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
background: #eee;
1111
}
1212
.box {
13-
position: relative;
1413
background: #ccc;
1514
border: 1px solid black;
1615
text-align: center;

lib/Resizable.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,16 @@ export default class Resizable extends React.Component {
9191

9292
render() {
9393
let p = this.props;
94+
let className = p.className ?
95+
`${p.className} react-resizable`:
96+
'react-resizable'
9497

9598
// What we're doing here is getting the child of this element, and cloning it with this element's props.
9699
// We are then defining its children as:
97100
// Its original children (resizable's child's children), and
98101
// A draggable handle.
99102
return cloneElement(p.children, assign({}, p, {
103+
className,
100104
children: [
101105
p.children.props.children,
102106
<DraggableCore

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test": "echo \"Error: no test specified\" && exit 1",
99
"build": "bash build.sh",
1010
"build-example": "webpack",
11-
"dev": "echo 'Open http://localhost:4002/examples/1.html'; NODE_ENV=test webpack-dev-server --config webpack-dev-server.config.js --hot --progress --colors --port 4002 --content-base .",
11+
"dev": "echo 'Open http://localhost:4002/examples/1.html' && cross-env NODE_ENV=test webpack-dev-server --config webpack-dev-server.config.js --hot --progress --colors --port 4002 --content-base .",
1212
"prepublish": "npm run build",
1313
"validate": "npm ls"
1414
},
@@ -33,6 +33,7 @@
3333
"babel-eslint": "^4.1.3",
3434
"babel-loader": "^5.3.2",
3535
"babel-plugin-typecheck": "^1.3.0",
36+
"cross-env": "^1.0.7",
3637
"css-loader": "^0.23.0",
3738
"eslint": "^1.9.0",
3839
"eslint-plugin-react": "^3.8.0",

0 commit comments

Comments
 (0)