| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * cbpFWTabs.js v1.0.0 |
| 3 | 3 | * http://www.codrops.com |
| 4 | 4 | * |
| @@ -54,25 +54,18 @@ | ||
| 54 | 54 | } ); |
| 55 | 55 | } ); |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | - CBPFWTabs.prototype._show = function( idx ) { | |
| 59 | - if( this.current >= 0 ) { | |
| 60 | - this.tabs[ this.current ].className = ''; | |
| 61 | - if( this.items[ this.current ] ) { | |
| 62 | - this.items[ this.current ].className = ''; | |
| 63 | - } | |
| 64 | - } | |
| 65 | - // change current | |
| 66 | - this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0; | |
| 67 | - this.tabs[ this.current ].className = 'tab-current'; | |
| 68 | - var sectionSelector = this.tabs[ this.current ].getAttribute( 'data-section' ); | |
| 69 | - var section = sectionSelector ? this.el.querySelector( sectionSelector ) : this.items[ this.current ]; | |
| 70 | - if( section ) { | |
| 71 | - section.className = 'content-current'; | |
| 72 | - } | |
| 73 | - }; | |
| 58 | + CBPFWTabs.prototype._show = function( idx ) { | |
| 59 | + if( this.current >= 0 ) { | |
| 60 | + this.tabs[ this.current ].className = this.items[ this.current ].className = ''; | |
| 61 | + } | |
| 62 | + // change current | |
| 63 | + this.current = idx != undefined ? idx : this.options.start >= 0 && this.options.start < this.items.length ? this.options.start : 0; | |
| 64 | + this.tabs[ this.current ].className = 'tab-current'; | |
| 65 | + this.items[ this.current ].className = 'content-current'; | |
| 66 | + }; | |
| 74 | 67 | |
| 75 | 68 | // add to global namespace |
| 76 | 69 | window.CBPFWTabs = CBPFWTabs; |
| 77 | 70 | |
| 78 | -})( window ); | |
| 71 | +})( window ); | |