PageSourceSearch

https://www.eecinc.us/assets/js/plugins/metismenu.js

js eecinc.us collected 2026-10-06 18:41:01 UTC 9,397 bytes, 203 lines download raw bytes

1/*!
2 * metismenu https://github.com/onokumus/metismenu#readme
3 * A jQuery menu plugin
4 * @version 3.0.6
5 * @author Osman Nuri Okumus <[email protected]> (https://github.com/onokumus)
6 * @license: MIT
7 */
8!(function (e, n) {
9    "object" == typeof exports && "undefined" != typeof module ? (module.exports = n(require("jquery"))) : "function" == typeof define && define.amd ? define(["jquery"], n) : ((e = e || self).metisMenu = n(e.jQuery));
10})(this, function (o) {
11    "use strict";
12    function a() {
13        return (a =
14            Object.assign ||
15            function (e) {
16                for (var n = 1; n < arguments.length; n++) {
17                    var t = arguments[n];
18                    for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
19                }
20                return e;
21            }).apply(this, arguments);
22    }
23    o = o && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
24    var i,
25        n,
26        r,
27        s =
28            ((n = "transitionend"),
29            (r = {
30                TRANSITION_END: "mmTransitionEnd",
31                triggerTransitionEnd: function (e) {
32                    i(e).trigger(n);
33                },
34                supportsTransitionEnd: function () {
35                    return Boolean(n);
36                },
37            }),
38            ((i = o).fn.mmEmulateTransitionEnd = e),
39            (i.event.special[r.TRANSITION_END] = {
40                bindType: n,
41                delegateType: n,
42                handle: function (e) {
43                    if (i(e.target).is(this)) return e.handleObj.handler.apply(this, arguments);
44                },
45            }),
46            r);
47    function e(e) {
48        var n = this,
49            t = !1;
50        return (
51            i(this).one(r.TRANSITION_END, function () {
52                t = !0;
53            }),
54            setTimeout(function () {
55                t || r.triggerTransitionEnd(n);
56            }, e),
57            this
58        );
59    }
60    var t = "metisMenu",
61        g = "metisMenu",
62        l = "." + g,
63        h = o.fn[t],
64        f = { toggle: !0, preventDefault: !0, triggerElement: "a", parentTrigger: "li", subMenu: "ul" },
65        d = { SHOW: "show" + l, SHOWN: "shown" + l, HIDE: "hide" + l, HIDDEN: "hidden" + l, CLICK_DATA_API: "click" + l + ".data-api" },
66        u = "metismenu",
67        c = "mm-active",
68        p = "mm-show",
69        m = "mm-collapse",
70        T = "mm-collapsing",
71        v = (function () {
72            function r(e, n) {
73                (this.element = e), (this.config = a({}, f, {}, n)), (this.transitioning = null), this.init();
74            }
75            var e = r.prototype;
76            return (
77                (e.init = function () {
78                    var a = this,
79                        s = this.config,
80                        e = o(this.element);
81                    e.addClass(u),
82                        e
83                            .find(s.parentTrigger + "." + c)
84                            .children(s.triggerElement)
85                            .attr("aria-expanded", "true"),
86                        e
87                            .find(s.parentTrigger + "." + c)
88                            .parents(s.parentTrigger)
89                            .addClass(c),
90                        e
91                            .find(s.parentTrigger + "." + c)
92                            .parents(s.parentTrigger)
93                            .children(s.triggerElement)
94                            .attr("aria-expanded", "true"),
95                        e
96                            .find(s.parentTrigger + "." + c)
97                            .has(s.subMenu)
98                            .children(s.subMenu)
99                            .addClass(m + " " + p),
100                        e
101                            .find(s.parentTrigger)
102                            .not("." + c)
103                            .has(s.subMenu)
104                            .children(s.subMenu)
105                            .addClass(m),
106                        e
107                            .find(s.parentTrigger)
108                            .children(s.triggerElement)
109                            .on(d.CLICK_DATA_API, function (e) {
110                                var n = o(this);
111                                if ("true" !== n.attr("aria-disabled")) {
112                                    s.preventDefault && "#" === n.attr("href") && e.preventDefault();
113                                    var t = n.parent(s.parentTrigger),
114                                        i = t.siblings(s.parentTrigger),
115                                        r = i.children(s.triggerElement);
116                                    t.hasClass(c) ? (n.attr("aria-expanded", "false"), a.removeActive(t)) : (n.attr("aria-expanded", "true"), a.setActive(t), s.toggle && (a.removeActive(i), r.attr("aria-expanded", "false"))),
117                                        s.onTransitionStart && s.onTransitionStart(e);
118                                }
119                            });
120                }),
121                (e.setActive = function (e) {
122                    o(e).addClass(c);
123                    var n = o(e).children(this.config.subMenu);
124                    0 < n.length && !n.hasClass(p) && this.show(n);
125                }),
126                (e.removeActive = function (e) {
127                    o(e).removeClass(c);
128                    var n = o(e).children(this.config.subMenu + "." + p);
129                    0 < n.length && this.hide(n);
130                }),
131                (e.show = function (e) {
132                    var n = this;
133                    if (!this.transitioning && !o(e).hasClass(T)) {
134                        var t = o(e),
135                            i = o.Event(d.SHOW);
136                        if ((t.trigger(i), !i.isDefaultPrevented())) {
137                            if ((t.parent(this.config.parentTrigger).addClass(c), this.config.toggle)) {
138                                var r = t
139                                    .parent(this.config.parentTrigger)
140                                    .siblings()
141                                    .children(this.config.subMenu + "." + p);
142                                this.hide(r);
143                            }
144                            t.removeClass(m).addClass(T).height(0), this.setTransitioning(!0);
145                            t.height(e[0].scrollHeight)
146                                .one(s.TRANSITION_END, function () {
147                                    n.config &&
148                                        n.element &&
149                                        (t
150                                            .removeClass(T)
151                                            .addClass(m + " " + p)
152                                            .height(""),
153                                        n.setTransitioning(!1),
154                                        t.trigger(d.SHOWN));
155                                })
156                                .mmEmulateTransitionEnd(350);
157                        }
158                    }
159                }),
160                (e.hide = function (e) {
161                    var n = this;
162                    if (!this.transitioning && o(e).hasClass(p)) {
163                        var t = o(e),
164                            i = o.Event(d.HIDE);
165                        if ((t.trigger(i), !i.isDefaultPrevented())) {
166                            t.parent(this.config.parentTrigger).removeClass(c), t.height(t.height())[0].offsetHeight, t.addClass(T).removeClass(m).removeClass(p), this.setTransitioning(!0);
167                            var r = function () {
168                                n.config && n.element && (n.transitioning && n.config.onTransitionEnd && n.config.onTransitionEnd(), n.setTransitioning(!1), t.trigger(d.HIDDEN), t.removeClass(T).addClass(m));
169                            };
170                            0 === t.height() || "none" === t.css("display") ? r() : t.height(0).one(s.TRANSITION_END, r).mmEmulateTransitionEnd(350);
171                        }
172                    }
173                }),
174                (e.setTransitioning = function (e) {
175                    this.transitioning = e;
176                }),
177                (e.dispose = function () {
178                    o.removeData(this.element, g), o(this.element).find(this.config.parentTrigger).children(this.config.triggerElement).off(d.CLICK_DATA_API), (this.transitioning = null), (this.config = null), (this.element = null);
179                }),
180                (r.jQueryInterface = function (i) {
181                    return this.each(function () {
182                        var e = o(this),
183                            n = e.data(g),
184                            t = a({}, f, {}, e.data(), {}, "object" == typeof i && i ? i : {});
185                        if ((n || ((n = new r(this, t)), e.data(g, n)), "string" == typeof i)) {
186                            if (void 0 === n[i]) throw new Error('No method named "' + i + '"');
187                            n[i]();
188                        }
189                    });
190                }),
191                r
192            );
193        })();
194    return (
195        (o.fn[t] = v.jQueryInterface),
196        (o.fn[t].Constructor = v),
197        (o.fn[t].noConflict = function () {
198            return (o.fn[t] = h), v.jQueryInterface;
199        }),
200        v
201    );
202});
203//# sourceMappingURL=metisMenu.min.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.