diff --git a/js/components/ascribe_forms/property_collapsible.js b/js/components/ascribe_forms/property_collapsible.js deleted file mode 100644 index 92970583..00000000 --- a/js/components/ascribe_forms/property_collapsible.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -import React from 'react'; -import ReactAddons from 'react/addons'; - -import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; -import Tooltip from 'react-bootstrap/lib/Tooltip'; -import Panel from 'react-bootstrap/lib/Panel'; - - -let PropertyCollapsile = React.createClass({ - propTypes: { - children: React.PropTypes.arrayOf(React.PropTypes.element), - checkboxLabel: React.PropTypes.string, - tooltip: React.PropTypes.string - }, - - getInitialState() { - return { - show: false - }; - }, - - handleFocus() { - this.refs.checkboxCollapsible.getDOMNode().checked = !this.refs.checkboxCollapsible.getDOMNode().checked; - this.setState({ - show: this.refs.checkboxCollapsible.getDOMNode().checked - }); - }, - - handleChange(event) { - this.setState({value: event.target.value}); - }, - - renderChildren() { - if(this.state.show) { - return ReactAddons.Children.map(this.props.children, (child) => { - return ReactAddons.addons.cloneWithProps(child, { - onChange: this.handleChange - }); - }); - } - }, - - reset() { - // If the child input is a native HTML element, it will be reset automatically - // by the DOM. - // However, we need to collapse this component again. - this.setState(this.getInitialState()); - }, - - render() { - let tooltip = ; - if (this.props.tooltip){ - tooltip = ( - - {this.props.tooltip} - ); - } - - let style = this.state.show ? {} : {paddingBottom: 0}; - - return ( -
- -
- - {/* PLEASE LEAVE THE SPACE BETWEEN LABEL and this.props.label */} - {this.props.checkboxLabel} -
-
- -
- {this.renderChildren()} -
-
-
- ); - } -}); - -export default PropertyCollapsile; \ No newline at end of file