remove bind methods
This commit is contained in:
@ -26,15 +26,17 @@ export default React.createClass({
|
|||||||
params: PropTypes.object
|
params: PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
onAnswer(answer, userAnswer, info, e) {
|
onAnswer(answer, userAnswer) {
|
||||||
if (e && e.preventDefault) {
|
return (e) => {
|
||||||
e.preventDefault();
|
if (e && e.preventDefault) {
|
||||||
}
|
e.preventDefault();
|
||||||
if (answer === userAnswer) {
|
}
|
||||||
debug('correct answer!');
|
if (answer === userAnswer) {
|
||||||
this.setState({ showInfo: true });
|
debug('correct answer!');
|
||||||
}
|
this.setState({ showInfo: true });
|
||||||
return debug('incorrect');
|
}
|
||||||
|
return debug('incorrect');
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onCorrectAnswer() {
|
onCorrectAnswer() {
|
||||||
@ -77,7 +79,7 @@ export default React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
backdrop={ false }
|
backdrop={ false }
|
||||||
onHide={ ::this.onCorrectAnswer }
|
onHide={ this.onCorrectAnswer }
|
||||||
show={ showInfo }>
|
show={ showInfo }>
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
<h3>
|
<h3>
|
||||||
@ -88,7 +90,7 @@ export default React.createClass({
|
|||||||
<Button
|
<Button
|
||||||
block={ true }
|
block={ true }
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
onClick={ ::this.onCorrectAnswer }>
|
onClick={ this.onCorrectAnswer }>
|
||||||
To next questions
|
To next questions
|
||||||
</Button>
|
</Button>
|
||||||
</Modal.Footer>
|
</Modal.Footer>
|
||||||
@ -116,13 +118,13 @@ export default React.createClass({
|
|||||||
<Button
|
<Button
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
className='pull-left'
|
className='pull-left'
|
||||||
onClick={ this.onAnswer.bind(this, answer, false, info) }>
|
onClick={ this.onAnswer(answer, false, info) }>
|
||||||
false
|
false
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
className='pull-right'
|
className='pull-right'
|
||||||
onClick={ this.onAnswer.bind(this, answer, true, info) }>
|
onClick={ this.onAnswer(answer, true, info) }>
|
||||||
true
|
true
|
||||||
</Button>
|
</Button>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
Reference in New Issue
Block a user