383001e4a00fcbe924d432d99c36977599a19580b18b4645837c596bf33e82b0

Source Code:

$(function () {
    var LEFTNAV_SUBMENU = $('.side-menu ul li.with-sub-menu');
    var className_check = false;

    if (navigator.userAgent.indexOf('iPad') > 0) {

        LEFTNAV_SUBMENU.on('touchstart', function (e) {

            if (e.currentTarget.className.indexOf('is-active') < 0) {
                LEFTNAV_SUBMENU.not(this).removeClass('is-active');
                $(this).addClass('is-active');
                className_check = true;
                return false;
            } else if (className_check === true && e.currentTarget.className.indexOf('is-active') > 0) {
                e.stopPropagation();
            };
        });

        $('#w').on('touchstart', function (e) {
            if (className_check === true) {

                if ($(e.target).parents('.list-sub-menu').length <= 0) {
                    LEFTNAV_SUBMENU.removeClass('is-active');
                    className_check = false;
                    e.preventDefault();
                };
            };
        });

    } else {

        LEFTNAV_SUBMENU.on({
            'mouseenter': function () {
                $(this).addClass('is-active');
            },
            'mouseleave': function () {
                $(this).removeClass('is-active');
            }
        });
    };
});