Skip to content

Commit ae0b4a0

Browse files
author
Thomas Bolis
committed
Upgrading to latest packages
Adding Zoom functionality
1 parent 711b466 commit ae0b4a0

File tree

3 files changed

+41
-36
lines changed

3 files changed

+41
-36
lines changed

examples/main.jsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class SketchFieldDemo extends React.Component {
8787
this._download = this._download.bind(this);
8888
this._renderTile = this._renderTile.bind(this);
8989
this._selectTool = this._selectTool.bind(this);
90+
this._onSketchChange = this._onSketchChange.bind(this);
9091

9192
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
9293

@@ -203,9 +204,19 @@ class SketchFieldDemo extends React.Component {
203204
this._sketch.clear();
204205
}
205206

207+
_onSketchChange() {
208+
let prev = this.state.canUndo;
209+
let now = this._sketch.canUndo();
210+
if (prev !== now) {
211+
this.setState({canUndo: now});
212+
}
213+
}
214+
206215
render() {
207216
return (
217+
208218
<MuiThemeProvider muiTheme={getMuiTheme()}>
219+
209220
<div>
210221

211222
{/* Application Bar with tools */}
@@ -261,16 +272,10 @@ class SketchFieldDemo extends React.Component {
261272
lineWidth={this.state.lineWidth}
262273
fillColor={this.state.fillWithColor ? this.state.fillColor : 'transparent'}
263274
scaleOnResize={true}
264-
height={660}
275+
height={760}
265276
defaultData={dataJson}
266277
defaultDataType="json"
267-
onChange={() => {
268-
let prev = this.state.canUndo;
269-
let now = this._sketch.canUndo();
270-
if(prev !== now){
271-
this.setState({canUndo: now});
272-
}
273-
}}
278+
onChange={this._onSketchChange}
274279
tool={this.state.tool}
275280
/>
276281
</div>

package.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -40,61 +40,59 @@
4040
"node": ">0.4.0 <1.0.0"
4141
},
4242
"devDependencies": {
43-
"babel-cli": "^6.10.1",
44-
"babel-core": "^6.9.1",
45-
"babel-eslint": "^6.0.5",
43+
"babel-cli": "^6.11.4",
44+
"babel-core": "^6.11.4",
45+
"babel-eslint": "^6.1.2",
4646
"babel-loader": "^6.2.4",
4747
"babel-plugin-transform-object-assign": "^6.8.0",
4848
"babel-plugin-transform-react-display-name": "^6.8.0",
49-
"babel-plugin-transform-runtime": "^6.9.0",
49+
"babel-plugin-transform-runtime": "^6.12.0",
5050
"babel-polyfill": "^6.9.1",
5151
"babel-preset-es2015": "^6.9.0",
5252
"babel-preset-es2015-loose": "^7.0.0",
53-
"babel-preset-react": "^6.5.0",
53+
"babel-preset-react": "^6.11.1",
5454
"babel-preset-react-hmre": "^1.1.1",
5555
"babel-preset-stage-0": "^6.5.0",
56-
"canvas": "^1.4.0",
56+
"canvas": "1.3.16",
5757
"chai": "^3.5.0",
58-
"core-js": "^2.4.0",
58+
"core-js": "^2.4.1",
5959
"css-loader": "^0.23.1",
60-
"eslint": "^2.13.1",
61-
"eslint-loader": "^1.3.0",
62-
"eslint-plugin-react": "^5.2.2",
63-
"fabric": "^1.6.2",
60+
"eslint": "^3.2.2",
61+
"eslint-loader": "^1.5.0",
62+
"eslint-plugin-react": "^6.0.0",
63+
"fabric": "1.6.2",
6464
"flexboxgrid": "^6.3.0",
65-
"html-webpack-plugin": "^2.21.0",
66-
"karma": "^0.13.22",
65+
"html-webpack-plugin": "^2.22.0",
66+
"karma": "^1.1.2",
6767
"karma-babel-preprocessor": "^6.0.1",
6868
"karma-chai": "^0.1.0",
69-
"karma-coverage": "^1.0.0",
70-
"karma-mocha": "^1.0.1",
71-
"karma-mocha-reporter": "^2.0.4",
72-
"karma-phantomjs-launcher": "^1.0.0",
69+
"karma-coverage": "^1.1.1",
70+
"karma-mocha": "^1.1.1",
71+
"karma-mocha-reporter": "^2.1.0",
72+
"karma-phantomjs-launcher": "^1.0.1",
7373
"karma-phantomjs-shim": "^1.4.0",
7474
"karma-sourcemap-loader": "^0.3.7",
7575
"karma-webpack": "^1.7.0",
76-
"material-ui": "^0.15.1",
77-
"mocha": "^2.5.3",
76+
"material-ui": "^0.15.3",
77+
"mocha": "^3.0.1",
7878
"my-local-ip": "^1.0.0",
7979
"open": "0.0.5",
8080
"open-browser-webpack-plugin": "0.0.2",
8181
"phantomjs": "^2.1.7",
82-
"phantomjs-prebuilt": "^2.1.7",
83-
"react": "^15.1.0",
84-
"react-addons-test-utils": "^15.1.0",
85-
"react-color": "^2.2.0",
86-
"react-dom": "^15.1.0",
82+
"phantomjs-prebuilt": "^2.1.10",
83+
"react-addons-test-utils": "15.2.1",
84+
"react-color": "^2.2.2",
8785
"react-hot-loader": "^1.3.0",
8886
"react-tap-event-plugin": "latest",
89-
"rimraf": "^2.5.2",
87+
"rimraf": "^2.5.4",
9088
"style-loader": "^0.13.1",
9189
"webpack": "^1.13.1",
9290
"webpack-dev-server": "^1.14.1",
9391
"weinre": "^2.0.0-pre-I0Z7U9OV"
9492
},
9593
"dependencies": {
96-
"react": "^15.1.0",
97-
"react-addons-pure-render-mixin": "^15.1.0",
98-
"react-dom": "^15.1.0"
94+
"react": "15.2.1",
95+
"react-addons-pure-render-mixin": "15.2.1",
96+
"react-dom": "15.2.1"
9997
}
10098
}

webpack.examples.cfg.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/*global __dirname,module*/
2+
13
const path = require('path');
24
const srcPath = path.join(__dirname, 'src');
35
const examplesPath = path.join(__dirname, 'examples');

0 commit comments

Comments
 (0)