pull/7/head
yann300 9 years ago
parent f1f883a5a3
commit 953ff7e958
  1. 4
      src/assemblyItemsBrowser.js
  2. 11
      src/slider.js

@ -40,7 +40,9 @@ module.exports = React.createClass({
<div style={style.container}><span style={style.address}>Current code: {this.state.currentAddress}</span></div> <div style={style.container}><span style={style.address}>Current code: {this.state.currentAddress}</span></div>
<div style={style.container}> <div style={style.container}>
<Slider ref="slider" onChange={this.selectState} min="0" max={this.props.vmTrace ? this.props.vmTrace.length : 0}/> <Slider ref="slider" onChange={this.selectState} min="0" max={this.props.vmTrace ? this.props.vmTrace.length : 0}/>
<ButtonNavigator vmTraceLength={this.props.vmTrace ? this.props.vmTrace.length : 0} step={this.state.currentSelected} stepIntoBack={this.stepIntoBack} stepIntoForward={this.stepIntoForward} stepOverBack={this.stepOverBack} stepOverForward={this.stepOverForward} /> <ButtonNavigator
vmTraceLength={this.props.vmTrace ? this.props.vmTrace.length : 0} step={this.state.currentSelected} stepIntoBack={this.stepIntoBack}
stepIntoForward={this.stepIntoForward} stepOverBack={this.stepOverBack} stepOverForward={this.stepOverForward} />
</div> </div>
<div style={style.container}> <div style={style.container}>
<table> <table>

@ -7,15 +7,14 @@ module.exports = React.createClass({
onChange: React.PropTypes.func.isRequired, onChange: React.PropTypes.func.isRequired,
}, },
getDefaultProps: function() getDefaultProps: function () {
{
return { return {
min: 0, min: 0,
max: 500 max: 500
}; };
}, },
render: function() { render: function () {
return ( return (
<div> <div>
<input ref="rule" style={style.rule} type="range" min={this.props.min} max={this.props.max} onMouseUp={this.onMouseUp} /> <input ref="rule" style={style.rule} type="range" min={this.props.min} max={this.props.max} onMouseUp={this.onMouseUp} />
@ -23,13 +22,11 @@ module.exports = React.createClass({
); );
}, },
onMouseUp: function(event) onMouseUp: function (event) {
{
this.props.onChange(parseInt(this.refs.rule.value)) this.props.onChange(parseInt(this.refs.rule.value))
}, },
setValue: function(value) setValue: function (value) {
{
var diff = value - this.refs.rule.value var diff = value - this.refs.rule.value
if (diff > 0) if (diff > 0)
this.refs.rule.stepUp(diff) this.refs.rule.stepUp(diff)

Loading…
Cancel
Save