smartinmedia/cunity

View on GitHub
lib/modules/Admin/styles/javascript/plugins/metisMenu/jquery.metisMenu.min.js

Summary

Maintainability
A
0 mins
Test Coverage
(function (e, c, a, g) {
    var d = "metisMenu", f = {toggle: true};

    function b(i, h) {
        this.element = i;
        this.settings = e.extend({}, f, h);
        this._defaults = f;
        this._name = d;
        this.init()
    }

    b.prototype = {
        init: function () {
            var i = e(this.element), h = this.settings.toggle;
            i.find("li.active").has("ul").children("ul").addClass("collapse in");
            i.find("li").not(".active").has("ul").children("ul").addClass("collapse");
            i.find("li").has("ul").children("a").on("click", function (j) {
                j.preventDefault();
                e(this).parent("li").toggleClass("active").children("ul").collapse("toggle");
                if (h) {
                    e(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")
                }
            })
        }
    };
    e.fn[d] = function (h) {
        return this.each(function () {
            if (!e.data(this, "plugin_" + d)) {
                e.data(this, "plugin_" + d, new b(this, h))
            }
        })
    }
})(jQuery, window, document);