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}><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>

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