File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11var tabularize = function ( ) {
2+
3+ var activateLink = function ( elem ) {
4+ $ ( ".active" ) . removeClass ( "active" ) ;
5+ elem . addClass ( "active" ) ;
6+ } ;
7+
28 var tabsWrapper = $ ( ".tabs" ) ;
39 var tabs = tabsWrapper . children ( "div" ) ;
410 var tabLinks = tabsWrapper . find ( ".tab-link" ) ;
@@ -8,18 +14,16 @@ var tabularize = function() {
814 if ( active ) {
915 tabs . hide ( ) ;
1016 $ ( active ) . show ( ) ;
11- $ ( ".active" ) . removeClass ( "active" ) ;
1217 $ ( ".tab-link" ) . each ( function ( ) {
1318 if ( $ ( this ) . attr ( "href" ) === active ) {
14- $ ( this ) . parent ( ) . addClass ( "active" ) ;
19+ activateLink ( $ ( this ) . parent ( ) ) ;
1520 }
1621 } ) ;
1722 }
1823 tabLinks . click ( function ( ) {
1924 tabs . hide ( ) ;
2025 $ ( $ ( this ) . attr ( "href" ) ) . show ( ) ;
21- $ ( ".active" ) . removeClass ( "active" ) ;
22- $ ( this ) . parent ( ) . addClass ( "active" ) ;
26+ activateLink ( $ ( this ) . parent ( ) ) ;
2327 return false ;
2428 } ) ;
2529} ;
You can’t perform that action at this time.
0 commit comments