Sha256: 2443dc1d3a2e20bf0c6290b5ea9f9710abe091ced526b3cac68130836eaa25fa
Contents?: true
Size: 1.82 KB
Versions: 8
Compression:
Stored size: 1.82 KB
Contents
(function() { Rev.registerComponent('Tabs', { getDefaultProps: function() { var props; return props = { onChange: function() {} }; }, getActiveTab: function() { var ref, ref1; return ((ref = this.state) != null ? ref.selectedKey : void 0) || this.props.activeKey || ((ref1 = this.getNormalizedChildren()[0]) != null ? ref1.key : void 0); }, renderTab: function(child) { var className, key; key = child.key; className = this.classSet({ active: key === this.getActiveTab() }); return React.createElement("dd", { "key": key, "className": className, "onClick": this.handleTabClick(child) }, child.props.tab); }, renderContent: function(child) { var newProps; newProps = { key: child.key }; if (child.key === this.getActiveTab()) { newProps.active = true; } return React.addons.cloneWithProps(child, newProps); }, render: function() { var children, dlClassName; children = this.getNormalizedChildren(); dlClassName = this.classSet({ tabs: true, vertical: this.props.vertical }); return React.createElement("div", null, React.createElement("dl", { "className": dlClassName }, children.map(this.renderTab)), React.createElement("div", { "className": "RevTabsContent tabs-content" }, children.map(this.renderContent))); }, handleTabClick: function(activeTab) { return (function(_this) { return function(e) { e.preventDefault(); e.stopPropagation(); _this.setState({ selectedKey: activeTab.key }); e.activeTab = activeTab; return _this.props.onChange(e); }; })(this); } }); }).call(this);
Version data entries
8 entries across 8 versions & 1 rubygems