Merge pull request #387 from sosaucily/disable_animated_bottom_border_on_tabs

Allow disabling animated bottom border on tabs
old
Javi Velasco 2016-03-17 08:32:00 +01:00
commit 69e6b928b8
3 changed files with 12 additions and 6 deletions

View File

@ -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"

View File

@ -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);
}
componentWillUnmount () {

View File

@ -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 <Tab> |
| `onChange` | `Function` | | Callback function that is fired when the tab changes.
| `className` | `String` | `''` | Additional class name to provide custom styling.|
| `index` | `Number` | `0` | Current <Tab> |
| `onChange` | `Function` | | Callback function that is fired when the tab changes.|
| `disableAnimatedBottomBorder` | `Boolean` | `false` | Disable the animation below the active tab
## Tab