<commit_before>// **Extends** Backbone.View
//
// **Usage** ```require(['toc-view'], function(TOCView) {})```
//
// **Jurisdiction** Expandable Table of Contents
define('toc-view', ['jquery', 'underscore', 'backbone', 'regs-dispatch', 'regs-helpers'], function($, _, Backbone, Dispatch, RegsHelpers) {
    'use strict';
    var TOCView = Backbone.View.extend({
        el: '#menu',

        events: {
            'click a': 'sendClickEvent'
        },

        initialize: function() {
            // **Event Listeners**
            // when the active section changes, highlight it in the TOC
            Dispatch.on('activeSection:change', this.setActive, this);
            
            Dispatch.on('toc:stateChange', this.changeContents, this);

            this.$children = $('.toc-container');
            this.childViews = {
                '#table-of-contents': $('#table-of-contents'),
                '#history': $('#history'),
                '#search': $('#search')
            };

            // **TODO** need to work out a bug where it scrolls the content section
            // $('#menu-link:not(.active)').on('click', this.scrollToActive);
        },<commit_msg>toc section id surfaced to template differently<commit_after>// **Extends** Backbone.View
//
// **Usage** ```require(['toc-view'], function(TOCView) {})```
//
// **Jurisdiction** Expandable Table of Contents
define('toc-view', ['jquery', 'underscore', 'backbone', 'regs-dispatch', 'regs-helpers'], function($, _, Backbone, Dispatch, RegsHelpers) {
    'use strict';
    var TOCView = Backbone.View.extend({
        el: '#menu',

        events: {
            'click a': 'sendClickEvent'
        },

        initialize: function() {
            // **Event Listeners**
            // when the active section changes, highlight it in the TOC
            Dispatch.on('activeSection:change', this.setActive, this);
            
            Dispatch.on('toc:stateChange', this.changeContents, this);

            this.$children = $('.toc-container');
            this.childViews = {
                '#table-of-contents': $('#table-of-contents'),
                '#history': $('#history'),
                '#search': $('#search')
            };

            this.setActive(Dispatch.getOpenSection());

            // **TODO** need to work out a bug where it scrolls the content section
            // $('#menu-link:not(.active)').on('click', this.scrollToActive);
        },
{'fraction_non_alphanumeric': 0.17635024549918166, 'fraction_numerical': 0.0, 'mean_word_length': 2.2128777923784493, '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': '1891070', 'n_tokens_mistral': 683, 'n_tokens_neox': 653, 'n_words': 159}