
jQuery(document).ready(function ($) {
$('.celp-tabsBtn').on('click', function (ev) {
    
    ev.preventDefault();
    let link = jQuery(this).attr('data-id');
    switch (link) {

        case '#celp-container-exchanges':
            // Do not generate if already generated
            if (!$.fn.dataTable.isDataTable('#celp_currency_pairs')) {
            $("#celp_currency_pairs").celpPairstable()
            }

            break;
        
        case '#celp-container-twitter-feeds':
           
            setTimeout(function(){
                    $('.celp_tweet_loader').hide()
            }, 1000);  
       
            break;
        case '#celp-container-facebook-comments':
           
            break;
    }
    $('.celp-tabsBtn').removeClass('active');
    $('.celp-data-container').removeClass('active')
    $(this).addClass('active');
    $(link).addClass('active');
})


});

