var Navbar = React.createClass({ getInitialState: function() { return { recordId: '' } }, handleChange: function(event) { var val = event.target.value; val = parseInt(val); if (val > 0) { this.setState({ recordId: val }); clearTimeout(this.uiv); this.uiv = setTimeout(function() { this.props.onNavigate({ view: 'show', recordId: this.state.recordId }); }.bind(this), 500); } else { this.props.onNavigate({ view: 'list', recordId: '' }); } }, onFocus: function() { setTimeout(function() { React.findDOMNode(this.refs.input).setSelectionRange(0, 10); }.bind(this), 100); }, navigateTo: function(view) { return function(event) { this.props.onNavigate({ view: view, clone: null }); }.bind(this) }, render: function() { return (
); } });