<commit_before>var App = {

	accessibleMenu: function(){
		var menu                 = $('.access-menu'),
            menu_item            = menu.find('> li > a'),

			subMenu              = $('.access-submenu'),
			subMenu_item         = subMenu.find('> li > a'),
			subMenu_last_item    = subMenu.find('> li:last-child > a'),

            isShow               = 'is-show';

		menu_item.bind({
			focus: function(){
				subMenu.removeClass(isShow);
				if($(this).next(subMenu)){
					$(this).next(subMenu).addClass(isShow);
				}
			},

			blur: function(){
				subMenu.removeClass(isShow);
			}
		});

		subMenu_item.bind({
			focus: function(){
				$(this).parent().parent().addClass(isShow);
			}
		});

		subMenu_last_item.bind({
			blur: function(){
				subMenu.removeClass(isShow);
			}
		});

		$(document).click(function(){
			if(subMenu.hasClass(isShow)){
				subMenu.removeClass(isShow);
			}
		});
	}

};

$(function(){
	App.accessibleMenu();
});<commit_msg>rewrite app.js<commit_after>var App = {

    accessibleMenu: function () {
        var _document           = $(document),

            menu                = $('.access-menu'),
            menu_item           = menu.find('> li > a'),

            subMenu             = $('.access-submenu'),
            subMenu_item        = subMenu.find('> li > a'),
            subMenu_last_item   = subMenu.find('> li:last-child > a'),

            isShow              = 'is-show';

        menu_item.bind({

            focus: function () {
                var _this           = $(this),
                    next_subMenu    = _this.next(subMenu);
                
                subMenu.removeClass(isShow);

                if ( next_subMenu ) {
                    next_subMenu.addClass(isShow);
                }

            },

            blur: function () {
                subMenu.removeClass(isShow);
            }

        });

        subMenu_item.bind({

            focus: function () {
                var _this           = $(this),
                    _this_parent    = _this.parent().parent();

                _this_parent.addClass(isShow);
            }

        });

        subMenu_last_item.bind({

            blur: function () {
                subMenu.removeClass(isShow);
            }

        });

        _document.click(function () {
            if ( subMenu.hasClass(isShow) ) {
                subMenu.removeClass(isShow);
            }
        });
    }

};

(function () {

    App.accessibleMenu();

})();
{'fraction_non_alphanumeric': 0.1482371794871795, 'fraction_numerical': 0.0, 'mean_word_length': 1.4172313649564376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2693570', 'n_tokens_mistral': 812, 'n_tokens_neox': 710, 'n_words': 105}