<commit_before>(($, window) ->
    class OffcanvasDropdown
        #   Public: Constructor for offcanvas
        #
        #   @element - Element that toggles the offcanvas
        constructor: (@element) ->
            @element = $ @element
            @nav = @element.closest ".nav"

            # Get dropdown element
            @dropdown = @element.parent().find ".dropdown-menu"

            # Click event
            @element.on 'click', @_clickEvent

            @nav.closest('.navbar-offcanvas').on 'click', =>
                if @dropdown.is('.shown')
                    @dropdown.removeClass('shown')
                      .closest('.active')
                      .removeClass('active')

        #   Private: Click event on link
        _clickEvent: (e) =>
            e.preventDefault() if !@dropdown.hasClass 'shown'
            e.stopPropagation()

            # Hide currently visible dropdown menus
            $('.dropdown-toggle').not(@element)
              .closest('.active')
              .removeClass 'active'
              .find '.dropdown-menu'
              .removeClass 'shown'

            # Show or hide element
            @dropdown.toggleClass "shown"
            @element.parent().toggleClass 'active'

    class OffcanvasTouch<commit_msg>Indentation<commit_after>(($, window) ->
    class OffcanvasDropdown
        #   Public: Constructor for offcanvas
        #
        #   @element - Element that toggles the offcanvas
        constructor: (@element) ->
            @element = $ @element
            @nav = @element.closest ".nav"

            # Get dropdown element
            @dropdown = @element.parent().find ".dropdown-menu"

            # Click event
            @element.on 'click', @_clickEvent

            @nav.closest('.navbar-offcanvas').on 'click', =>
                if @dropdown.is('.shown')
                    @dropdown.removeClass('shown').closest('.active').removeClass('active')

        #   Private: Click event on link
        _clickEvent: (e) =>
            e.preventDefault() if !@dropdown.hasClass 'shown'
            e.stopPropagation()

            # Hide currently visible dropdown menus
            $('.dropdown-toggle').not(@element)
              .closest('.active')
              .removeClass 'active'
              .find '.dropdown-menu'
              .removeClass 'shown'

            # Show or hide element
            @dropdown.toggleClass "shown"
            @element.parent().toggleClass 'active'

    class OffcanvasTouch
{'fraction_non_alphanumeric': 0.11929543634907927, 'fraction_numerical': 0.0, 'mean_word_length': 1.6222455403987408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4108337', 'n_tokens_mistral': 635, 'n_tokens_neox': 608, 'n_words': 145}