| 1 |
(function($) { |
| 2 |
|
| 3 |
CopyTheCodePage = { |
| 4 |
/** |
| 5 |
* Init |
| 6 |
*/ |
| 7 |
init: function() |
| 8 |
{ |
| 9 |
this._bind(); |
| 10 |
$('.copy-the-code .nav-tab-wrapper > .nav-tab:first-child').addClass('nav-tab-active'); |
| 11 |
}, |
| 12 |
|
| 13 |
_bind: function() |
| 14 |
{ |
| 15 |
$( document ).on('click', '.nav-tab', CopyTheCodePage._switch_tab ); |
| 16 |
}, |
| 17 |
|
| 18 |
_switch_tab: function( event ) { |
| 19 |
$(this).siblings().removeClass('nav-tab-active'); |
| 20 |
$(this).addClass('nav-tab-active'); |
| 21 |
$( '#' + $(this).attr( 'data-id' ) ).siblings().hide(); |
| 22 |
$( '#' + $(this).attr( 'data-id' ) ).show(); |
| 23 |
} |
| 24 |
|
| 25 |
}; |
| 26 |
|
| 27 |
/** |
| 28 |
* Initialization |
| 29 |
*/ |
| 30 |
$(function() { |
| 31 |
CopyTheCodePage.init(); |
| 32 |
}); |
| 33 |
|
| 34 |
})(jQuery); |
| 35 |
|
| 36 |
|