<commit_before>// function init_sidebar(options){

//     default_options = {
//         max_wrapper_width: 1150,
//         sidebar_enabled: true,
//         sidebar_visible: true,
//         menu_element: "#example_menu"
//     }
//     options = options || {};
//     options = $.extend({}, default_options, options);
//     $menu_element = $(options.menu_element);
    
//     if($menu_element.length>0){
//         $menu_element.find("i").removeClass("icon-home").addClass("icon-list");        
//         $menu_element.parent().click(function(e){
//             e.preventDefault()
//             if (options.sidebar_visible) {
//                 options.sidebar_enabled = false;
//                 hide_sidebar(options);
//             } else {
//                 options.sidebar_enabled = true;
//                 show_sidebar(options);
//             }
//         });
//         sidebar_resize(options);
//         $(window).resize(function(){
//             sidebar_resize(options);
//         });
//     }
// }

// function sidebar_resize(options) {
//     options = options || {}; 
//     options.width = $(window).width();
//     var height = $(window).height();
//     var nav = $(".navbar").height();
    
//     $(".sidenav").height(height-nav);
    
//     if (options.width<options.max_wrapper_width) {
//         hide_sidebar(options)
//     } else {
//         if (options.sidebar_enabled) show_sidebar(options)
//     }
// }

$(function(){
    // recreate the bootstrap collapse... but slide from left
    $(document).on('click', '[data-toggle="slide-collapse"]', function(event) {
        event.preventDefault(event);
        var collapsed = this.classList.contains('collapsed');
        $btn = $(this);
        target = $btn.data('target');
        if (!collapsed) {
            $('[data-toggle="slide-collapse"][data-target="' + target + '"]').addClass('collapsed');
            hide_sidebar();
        } else {
            $('[data-toggle="slide-collapse"][data-target="' + target + '"]').removeClass('collapsed');
            show_sidebar();
        }
    });
    
    // trigger the events to allow module js scripts to attach actions to the events
    function show_sidebar(options) {
        // @note: assumes the css animation takes 300ms
        $('#sidebar').trigger('show.sidebar.collapse');
        setTimeout(function(){
            $('#sidebar').trigger('shown.sidebar.collapse');
        }, 350);
        $('body').removeClass('collapsed');
    }
    function hide_sidebar(options) {
        // @note: assumes the css animation takes 300ms
        $('#sidebar').trigger('hide.sidebar.collapse');
        setTimeout(function(){
            $('#sidebar').trigger('hidden.sidebar.collapse');
        }, 350);
        $('body').addClass('collapsed');
    }

    // open sidebar if active page link clicked
    $('#left-nav li.active a').on('mouseenter', function(event){
        event.preventDefault();
        if($('body').hasClass('collapsed')) {
            $('#sidebar-toggle').click();
        }
    });
    // open sidebar if active page link clicked
    $('#left-nav li.active a').on('click', function(event){
        event.preventDefault();
        $('#sidebar-toggle').click();
    });

    // on trigger sidebar hide/show
    $('#sidebar').on('hide.sidebar.collapse show.sidebar.collapse', function(event){
        // resize after slight delay
        var interval = setInterval(function(){
            if (typeof graph_resize === 'function'){
                graph_resize();
            }
            if (typeof graph_draw === 'function'){
                graph_draw();
            }
        }, 75);
        // stop resizing<commit_msg>removed on hover open of active sidebar button<commit_after>$(function(){
    // recreate the bootstrap collapse... but slide from left
    $(document).on('click', '[data-toggle="slide-collapse"]', function(event) {
        event.preventDefault(event);
        var collapsed = this.classList.contains('collapsed');
        $btn = $(this);
        target = $btn.data('target');
        if (!collapsed) {
            $('[data-toggle="slide-collapse"][data-target="' + target + '"]').addClass('collapsed');
            hide_sidebar();
        } else {
            $('[data-toggle="slide-collapse"][data-target="' + target + '"]').removeClass('collapsed');
            show_sidebar();
        }
    });
    
    // trigger the events to allow module js scripts to attach actions to the events
    function show_sidebar(options) {
        // @note: assumes the css animation takes 300ms
        $('#sidebar').trigger('show.sidebar.collapse');
        setTimeout(function(){
            $('#sidebar').trigger('shown.sidebar.collapse');
        }, 350);
        $('body').removeClass('collapsed');
    }
    function hide_sidebar(options) {
        // @note: assumes the css animation takes 300ms
        $('#sidebar').trigger('hide.sidebar.collapse');
        setTimeout(function(){
            $('#sidebar').trigger('hidden.sidebar.collapse');
        }, 350);
        $('body').addClass('collapsed');
    }

    // open sidebar if active page link clicked
    $('#left-nav li.active a').on('mouseenter', function(event){
        event.preventDefault();
        if($('body').hasClass('collapsed')) {
            // $('#sidebar-toggle').click();
        }
    });
    // open sidebar if active page link clicked
    $('#left-nav li.active a').on('click', function(event){
        event.preventDefault();
        $('#sidebar-toggle').click();
    });

    // on trigger sidebar hide/show
    $('#sidebar').on('hide.sidebar.collapse show.sidebar.collapse', function(event){
        // resize after slight delay
        var interval = setInterval(function(){
            if (typeof graph_resize === 'function'){
                graph_resize();
            }
            if (typeof graph_draw === 'function'){
                graph_draw();
            }
        }, 75);
        // stop resizing
{'fraction_non_alphanumeric': 0.17440885460338756, 'fraction_numerical': 0.005534127117222874, 'mean_word_length': 2.137296159915834, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1504316', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1564, 'n_words': 316}