pull/7/head
yann300 9 years ago
parent f1f883a5a3
commit 953ff7e958
  1. 4
      src/assemblyItemsBrowser.js
  2. 63
      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}>
<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 style={style.container}>
<table>

@ -2,38 +2,35 @@ 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
};
},
render: function() {
return (
<div>
<input ref="rule" style={style.rule} type="range" min={this.props.min} max={this.props.max} onMouseUp={this.onMouseUp} />
</div>
);
},
onMouseUp: function(event)
{
this.props.onChange(parseInt(this.refs.rule.value))
},
setValue: function(value)
{
var diff = value - this.refs.rule.value
if (diff > 0)
this.refs.rule.stepUp(diff)
else
this.refs.rule.stepDown(Math.abs(diff))
}
propTypes: {
onChange: React.PropTypes.func.isRequired,
},
getDefaultProps: function () {
return {
min: 0,
max: 500
};
},
render: function () {
return (
<div>
<input ref="rule" style={style.rule} type="range" min={this.props.min} max={this.props.max} onMouseUp={this.onMouseUp} />
</div>
);
},
onMouseUp: function (event) {
this.props.onChange(parseInt(this.refs.rule.value))
},
setValue: function (value) {
var diff = value - this.refs.rule.value
if (diff > 0)
this.refs.rule.stepUp(diff)
else
this.refs.rule.stepDown(Math.abs(diff))
}
})

Loading…
Cancel
Save