var React = require('react'); var FeatureForm = require('./FeatureForm'); var LogEntryList = require('../log/LogEntryList'); var eventStore = require('../../stores/EventStore'); var Feature = React.createClass({ getInitialState: function() { return { editMode: false, showHistory: false, events: [] }; }, handleEventsResponse: function(response) { this.setState({events: response}); }, toggleHistory: function() { eventStore.getEventsByName(this.props.feature.name).then(this.handleEventsResponse); this.setState({showHistory: !this.state.showHistory}); }, toggleEditMode: function() { this.setState({editMode: !this.state.editMode}); }, saveFeature: function(feature) { this.props.onChange(feature); this.toggleEditMode(); }, renderEditMode: function() { return (