Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ options | Options for path drawing. See [progressbar.js documentation
initialAnimate | If `true`, progress bar is animated to given progress when mounted. Default `false`.
containerStyle | Styles for progress bar container. Default `{}`.
containerClassName | Class name for progress bar container. Default `.progressbar-container`.
onAnimationEnd | Callback when animation ends.

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion dist/react-progressbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
},

_animateProgress: function _animateProgress(progress) {
this.state.shape.animate(progress);
this.state.shape.animate(progress, this.props.onAnimationEnd);
},

_setProgress: function _setProgress(progress) {
Expand Down
6 changes: 5 additions & 1 deletion local-dev/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var App = React.createClass({
},

render: function() {
return <Circle initialAnimate={this.state.initialAnimate} options={this.state.options} progress={this.state.progress} />;
return <Circle onAnimationEnd={this.onAnimationEnd} initialAnimate={this.state.initialAnimate} options={this.state.options} progress={this.state.progress} />;
},

componentDidMount: function() {
Expand All @@ -32,6 +32,10 @@ var App = React.createClass({
});
}, 500);

},

onAnimationEnd() {
console.log('animation end');
}
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
]
},
"scripts": {
"start": "concurrent 'npm run serve' 'npm run watch-js' 'open http://localhost:8080'",
"start": "concurrently \"npm run serve\" \"npm run watch-js\" \"open http://localhost:8080\"",
"watch-js": "watchify local-dev/main.js -t reactify -o local-dev/bundle.js --debug --verbose",
"build": "babel src/main.js -o ./dist/react-progressbar.js",
"serve": "http-server ./local-dev -c 0",
"lint": "./tools/lint.sh",
"jscs": "jscs ./src ./test",
"eslint": "eslint --ext .js ./src ./test"
}
}
}
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var Shape = React.createClass({
},

_animateProgress: function _animateProgress(progress) {
this.state.shape.animate(progress);
this.state.shape.animate(progress, this.props.onAnimationEnd);
},

_setProgress: function _setProgress(progress) {
Expand Down