From a2543d4a11e7ad68134c965cd4744d5a24eeaf20 Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Wed, 16 Mar 2016 14:56:20 -0700 Subject: [PATCH 1/2] Allow disabling animated bottom border on tabs --- components/tabs/Tabs.jsx | 7 +++++-- components/tabs/readme.md | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/tabs/Tabs.jsx b/components/tabs/Tabs.jsx index fd3b1ab5..33544ff8 100644 --- a/components/tabs/Tabs.jsx +++ b/components/tabs/Tabs.jsx @@ -7,6 +7,7 @@ class Tabs extends React.Component { static propTypes = { children: React.PropTypes.node, className: React.PropTypes.string, + disableAnimatedBottomBorder: React.PropTypes.bool, index: React.PropTypes.number, onChange: React.PropTypes.func }; @@ -20,11 +21,13 @@ class Tabs extends React.Component { }; componentDidMount () { - this.updatePointer(this.props.index); + !this.props.disableAnimatedBottomBorder && + this.updatePointer(this.props.index); } componentWillReceiveProps (nextProps) { - this.updatePointer(nextProps.index); + !this.props.disableAnimatedBottomBorder && + this.updatePointer(nextProps.index); } handleHeaderClick = (idx) => { diff --git a/components/tabs/readme.md b/components/tabs/readme.md index a93baccb..2a55f0b1 100644 --- a/components/tabs/readme.md +++ b/components/tabs/readme.md @@ -39,9 +39,10 @@ This component acts as the wrapper and the main controller of the content that i | Name | Type | Default | Description| |:-----|:-----|:-----|:-----| -| `className` | `String` | `''` | Additional class name to provide custom styling.| -| `index` | `Number` | `0` | Current | -| `onChange` | `Function` | | Callback function that is fired when the tab changes. +| `className` | `String` | `''` | Additional class name to provide custom styling.| +| `index` | `Number` | `0` | Current | +| `onChange` | `Function` | | Callback function that is fired when the tab changes.| +| `disableAnimatedBottomBorder` | `Boolean` | `false` | Disable the animation below the active tab ## Tab From e6c5be228db186930a494dca167880284b5f63c1 Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Wed, 16 Mar 2016 15:21:18 -0700 Subject: [PATCH 2/2] fix lint issue by ammending rule --- .eslintrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 6f9f9cd8..34a4aabb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -149,7 +149,9 @@ "no-undefined": [0], "no-underscore-dangle": [0], "no-unreachable": [2], - "no-unused-expressions": [2], + "no-unused-expressions": [2, { + "allowShortCircuit": true + }], "no-unused-vars": [1, { "vars": "all", "args": "after-used"