Sha256: de492d6db0093859251b89d8e558847ee6de87134a28febd531b7ef459f49611

Contents?: true

Size: 651 Bytes

Versions: 6

Compression:

Stored size: 651 Bytes

Contents

Rev.registerComponent('Tabs', class extends React.Component {

  static get propTypes() {
    return {
      activeKey: React.PropTypes.string,
      onChange: React.PropTypes.function,
    }
  }

  constructor(props) {
    super(props)
    this.state = {
      activeKey: props.activeKey,
    }
    this.handleChange = this.handleChange.bind(this)
  }

  handleChange(e) {
    this.setState({activeKey: e.activeTab.key})
    if(this.props.onChange) {
      this.props.onChange(e)
    }
  }

  render() {
    return <Rev.Components.StatelessTabs {...this.props}
      activeKey={this.state.activeKey}
      onChange={this.handleChange}
    />
  }

})

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
revelry_core-0.1.12.6 app/assets/javascripts/revelry/ui/tabs/Tabs.es6
revelry_core-0.1.12.5 app/assets/javascripts/revelry/ui/tabs/Tabs.es6
revelry_core-0.1.12.4 app/assets/javascripts/revelry/ui/tabs/Tabs.es6
revelry_core-0.1.12.3 app/assets/javascripts/revelry/ui/tabs/Tabs.es6
revelry_core-0.1.12.2 app/assets/javascripts/revelry/ui/tabs/Tabs.es6
revelry_core-0.1.12.0 app/assets/javascripts/revelry/ui/tabs/Tabs.es6