Skip to content

Commit

Permalink
fix :
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Apr 29, 2015
1 parent 8eead00 commit 48f22e9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions react-progress-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
type: React.PropTypes.string
},

getDefaultProps() {
getDefaultProps: function() {
return {
classNamespace: 'pb-',
durationError: 1200,
Expand All @@ -31,13 +31,13 @@
};
},

getInitialState() {
getInitialState: function() {
return {
currentState: this.props.state
};
},

render() {
render: function() {
return (
React.createElement("div", {className: this.props.classNamespace + "container " + this.state.currentState,
onClick: this.props.onClick},
Expand Down Expand Up @@ -65,7 +65,7 @@
);
},

getStateClass() {
getStateClass: function() {
var className = "workout-progress";
if (this.props.insightIndex >= this.props.insights.items.length) {
className += " complete";
Expand All @@ -75,15 +75,15 @@
return className;
},

loading() {
loading: function() {
this.setState({currentState: 'loading'});
},

notLoading() {
notLoading: function() {
this.setState({currentState: ''});
},

success(callback) {
success: function(callback) {
this.setState({currentState: 'success'});
this._timeout = setTimeout(function() {
callback = callback || this.props.onSuccess;
Expand All @@ -94,7 +94,7 @@
}.bind(this), this.props.durationSuccess);
},

error(callback) {
error: function(callback) {
this.setState({currentState: 'error'});
this._timeout = setTimeout(function() {
callback = callback || this.props.onError;
Expand All @@ -105,7 +105,7 @@
}.bind(this), this.props.durationError);
},

componentWillReceiveProps(nextProps) {
componentWillReceiveProps: function(nextProps) {
switch(nextProps.state) {
case 'success':
this.success();
Expand All @@ -124,7 +124,7 @@
}
},

componentWillUnmount() {
componentWillUnmount: function() {
clearTimeout(this._timeout);
}
});
Expand Down

0 comments on commit 48f22e9

Please sign in to comment.