parent
a096a912b3
commit
5d54ced57e
@ -0,0 +1,31 @@ |
||||
var React = require('react'); |
||||
var style = require('./sliderStyles') |
||||
|
||||
module.exports = React.createClass({ |
||||
|
||||
propTypes: { |
||||
onChange: React.PropTypes.func.isRequired, |
||||
},
|
||||
|
||||
getDefaultProps: function()
|
||||
{ |
||||
return { |
||||
min: 0, |
||||
max: 500, |
||||
step: 0 |
||||
}; |
||||
}, |
||||
|
||||
render: function() {
|
||||
return ( |
||||
<div> |
||||
<input style={style.rule} type="range" value={this.props.step} min={this.props.min} max={this.props.max} onChange={this.onChange} />
|
||||
</div> |
||||
); |
||||
}, |
||||
|
||||
onChange: function(event) |
||||
{ |
||||
this.props.onChange(event.currentTarget.value) |
||||
} |
||||
}) |
@ -0,0 +1,17 @@ |
||||
module.exports = { |
||||
rule: |
||||
{ |
||||
'width': '600px', |
||||
},
|
||||
runner: |
||||
{ |
||||
'position': 'absolute', |
||||
'width': '16px', |
||||
'height': '16px', |
||||
'margin': '0', |
||||
'padding': '0', |
||||
'overflow': 'hidden', |
||||
'border': '1px solid #a4bed4', |
||||
'background-color': '#f1f7ff' |
||||
} |
||||
} |
@ -0,0 +1,30 @@ |
||||
var React = require('react'); |
||||
|
||||
module.exports = React.createClass({ |
||||
|
||||
propTypes: { |
||||
stepIntoBack: React.PropTypes.func.isRequired, |
||||
stepIntoForward: React.PropTypes.func.isRequired, |
||||
stepOverBack: React.PropTypes.func.isRequired, |
||||
stepOverForward: React.PropTypes.func.isRequired, |
||||
}, |
||||
|
||||
render: function() {
|
||||
return ( |
||||
<div> |
||||
<button onClick={this.props.stepIntoBack} disabled={this.checkButtonState(-1)} >Step Into Back</button> |
||||
<button onClick={this.props.stepOverBack} disabled={this.checkButtonState(-1)} >Step Over Back</button> |
||||
<button onClick={this.props.stepOverForward} disabled={this.checkButtonState(1)} >Step Over Forward</button> |
||||
<button onClick={this.props.stepIntoForward} disabled={this.checkButtonState(1)} >Step Into Forward</button> |
||||
</div> |
||||
); |
||||
}, |
||||
|
||||
checkButtonState: function(incr) |
||||
{ |
||||
if (incr === -1) |
||||
return this.props.step === 0 ? "disabled" : "" |
||||
else if (incr === 1) |
||||
return this.props.step >= this.props.vmTraceLength - 1 ? "disabled" : ""
|
||||
}, |
||||
}) |
Loading…
Reference in new issue