<commit_before>var LightSliderHomeInit = function() {

    //
    // Init
    //
    this.init();

};

LightSliderHomeInit.prototype.init = function() {

    var that = this;

    $('[data-slider-home]').lightSlider({
        item: 1,
        slideMargin: 0,
        pager: false,
        loop: true,
        onAfterSlide: function(slider) {
            var $pages = slider.parents('.slider-home').find('.slider-home__pager li');
            $pages.removeClass('active');
            console.log(slider.getCurrentSlideCount());
            $($pages[slider.getCurrentSlideCount()-1]).addClass('active');
        },
        onSliderLoad: function(slider) {
            var $pages = slider.parents('.slider-home').find('.slider-home__pager li');
            $pages.each(function(idx) {
                var that = $(this);
                that.click(function(e) {
                    e.preventDefault();
                    $pages.removeClass('active');
                    that.addClass('active');
                    slider.goToSlide(idx);
                    return false;
                });

            });
        }
    });

};

module.exports = LightSliderHomeInit;
<commit_msg>Fix the loop on the home slider<commit_after>var LightSliderHomeInit = function() {

    //
    // Init
    //
    this.init();

};

LightSliderHomeInit.prototype.init = function() {

    var that = this;

    $('[data-slider-home]').lightSlider({
        item: 1,
        slideMargin: 0,
        pager: false,
        loop: true,
        onAfterSlide: function(slider) {
            var $pages = slider.parents('.slider-home').find('.slider-home__pager li');
            $pages.removeClass('active');
            $($pages[slider.getCurrentSlideCount()-1]).addClass('active');
        },
        onSliderLoad: function(slider) {
            var $pages = slider.parents('.slider-home').find('.slider-home__pager li');
            $pages.each(function(idx) {
                var that = $(this);
                that.click(function(e) {
                    e.preventDefault();
                    $pages.removeClass('active');
                    that.addClass('active');
                    slider.goToSlide(idx+1);
                    return false;
                });

            });
        }
    });

};

module.exports = LightSliderHomeInit;

{'fraction_non_alphanumeric': 0.14690721649484537, 'fraction_numerical': 0.003006872852233677, 'mean_word_length': 1.6770114942528735, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7141494', 'n_tokens_mistral': 653, 'n_tokens_neox': 638, 'n_words': 99}