<commit_before><template>
    <div class="main-container">
        <div class="swipe-tabs-container" ref="tabContainer">
            <slot></slot>
        </div>
    </div>
</template>

<script>
    import ScrollBar from './ScrollBar.vue';
    import '../plugin/slick/slick.js';
    import '../plugin/slick/slick.css';
    export default {
        props: {
            element: String,
            size: {
                default: 3,
                type: Number,
            },
            swipe: {
                default: true,
                type: Boolean,
            }
        },
        mounted(){
            var self= this;
            self.$nextTick(()=> {
                let siblingsHeight = 0;
                $(self.$el).siblings().each(function() {
                    siblingsHeight += $(this).outerHeight();
                });
                $(self.$el).find(".swipe-tab-content").each(function() {
                    this.style.height = (self.$el.parentNode.offsetHeight - siblingsHeight -2) + "px";
                    self.$el.childNodes[0].style.height = this.style.height;
                    $(this).resize(function() {
                        this.style.height = (self.$el.parentNode.offsetHeight - siblingsHeight -2) + "px";
                        self.$refs.tabContainer.style.height = this.style.height;
                    })
                });
                var $swipeTabsContainer = $(self.element).find('.swipe-tabs'),
                    $swipeTabs = $swipeTabsContainer.find('.swipe-tab'),
                    $swipeTabsContentContainer = $(self.$el).find('.swipe-tabs-container'),
                    currentIndex = 0,
                    activeTabClassName = 'active-tab';

                $swipeTabsContainer.on('init', function(event, slick) {
                    $swipeTabsContentContainer.removeClass('invisible');
                    $swipeTabsContainer.removeClass('invisible');
                    currentIndex = slick.getCurrent();
                    $swipeTabs.removeClass(activeTabClassName);
                    $('.swipe-tab[data-slick-index=' + currentIndex + ']').addClass(activeTabClassName);
                });

                $swipeTabsContainer.slick({
                    slidesToShow: self.size,
                    slidesToScroll: 1,
                    arrows: false,
                    infinite: false,
                    swipeToSlide: true,
                    touchThreshold: 10,
                });
                $swipeTabsContentContainer.slick({
                    asNavFor: $swipeTabsContainer,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    arrows: false,
                    infinite: false,
                    swipeToSlide: true,
                    swipe: self.swipe,
                    draggable: false,
                    edgeFriction: 0,
                    speed: 200,
                    touchThreshold: 10,
                });


                $swipeTabs.on('click', function(event) {
                    // gets index of clicked tab
                    currentIndex = $(this).data('slick-index');
                    $swipeTabs.removeClass(activeTabClassName);
                    $swipeTabsContainer.find('.swipe-tab[data-slick-index=' + currentIndex +']').addClass(activeTabClassName);
                    $swipeTabsContainer.slick('slickGoTo', (currentIndex-1));
                    $swipeTabsContentContainer.slick('slickGoTo', currentIndex);
                });

                //initializes slick navigation tabs swipe handler
                $swipeTabsContentContainer.on('swipe', function(event, slick, direction) {
                    currentIndex = $(this).slick('slickCurrentSlide');
                    $swipeTabs.removeClass(activeTabClassName);
                    $swipeTabsContainer.find('.swipe-tab[data-slick-index=' + currentIndex + ']').addClass(activeTabClassName);
                    $swipeTabsContainer.slick('slickGoTo', (currentIndex-1));
                    // console.log(currentIndex - 1);
                });

                
            })
        }
    }
</script><commit_msg>at emit function after slide<commit_after><template>
    <div class="main-container">
        <div class="swipe-tabs-container" ref="tabContainer">
            <slot></slot>
        </div>
    </div>
</template>

<script>
    import ScrollBar from './ScrollBar.vue';
    import '../plugin/slick/slick.js';
    import '../plugin/slick/slick.css';
    export default {
        props: {
            element: String,
            size: {
                default: 3,
                type: Number,
            },
            swipe: {
                default: true,
                type: Boolean,
            }
        },
        mounted(){
            var self= this;
            self.$nextTick(()=> {
                let siblingsHeight = 0;
                $(self.$el).siblings().each(function() {
                    siblingsHeight += $(this).outerHeight();
                });
                $(self.$el).find(".swipe-tab-content").each(function() {
                    this.style.height = (self.$el.parentNode.offsetHeight - siblingsHeight -2) + "px";
                    self.$el.childNodes[0].style.height = this.style.height;
                    $(this).resize(function() {
                        this.style.height = (self.$el.parentNode.offsetHeight - siblingsHeight -2) + "px";
                        self.$refs.tabContainer.style.height = this.style.height;
                    })
                });
                var $swipeTabsContainer = $(self.element).find('.swipe-tabs'),
                    $swipeTabs = $swipeTabsContainer.find('.swipe-tab'),
                    $swipeTabsContentContainer = $(self.$el).find('.swipe-tabs-container'),
                    currentIndex = 0,
                    activeTabClassName = 'active-tab';

                $swipeTabsContainer.on('init', function(event, slick) {
                    $swipeTabsContentContainer.removeClass('invisible');
                    $swipeTabsContainer.removeClass('invisible');
                    currentIndex = slick.getCurrent();
                    $swipeTabs.removeClass(activeTabClassName);
                    $('.swipe-tab[data-slick-index=' + currentIndex + ']').addClass(activeTabClassName);
                });

                $swipeTabsContainer.slick({
                    slidesToShow: self.size,
                    slidesToScroll: 1,
                    arrows: false,
                    infinite: false,
                    swipeToSlide: true,
                    touchThreshold: 10,
                });
                $swipeTabsContentContainer.slick({
                    asNavFor: $swipeTabsContainer,
                    slidesToShow: 1,
                    slidesToScroll: 1,
                    arrows: false,
                    infinite: false,
                    swipeToSlide: true,
                    swipe: self.swipe,
                    draggable: false,
                    edgeFriction: 0,
                    speed: 200,
                    touchThreshold: 10,
                });


                $swipeTabs.on('click', function(event) {
                    // gets index of clicked tab
                    currentIndex = $(this).data('slick-index');
                    $swipeTabs.removeClass(activeTabClassName);
                    $swipeTabsContainer.find('.swipe-tab[data-slick-index=' + currentIndex +']').addClass(activeTabClassName);
                    $swipeTabsContainer.slick('slickGoTo', (currentIndex-1));
                    $swipeTabsContentContainer.slick('slickGoTo', currentIndex);
                });

                //initializes slick navigation tabs swipe handler
                $swipeTabsContentContainer.on('swipe', function(event, slick, direction) {
                    currentIndex = $(this).slick('slickCurrentSlide');
                    $swipeTabs.removeClass(activeTabClassName);
                    $swipeTabsContainer.find('.swipe-tab[data-slick-index=' + currentIndex + ']').addClass(activeTabClassName);
                    $swipeTabsContainer.slick('slickGoTo', (currentIndex-1));
                    // console.log(currentIndex - 1);
                });

                $swipeTabsContentContainer.on('afterChange', function(slick, currentSlide){
                    self.$emit("slideChange", currentSlide.currentSlide);
                    // self.lastSlide = (currentSlide.slideCount -1) === currentSlide.currentSlide;
                });

                
            })
        }
    }
</script>
{'fraction_non_alphanumeric': 0.12183507549361208, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 1.3800442233278054, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '2644166', 'n_tokens_mistral': 2275, 'n_tokens_neox': 2111, 'n_words': 326}