Team:XMU-China/js/mobile-nav

! function(y, e) {

   "use strict";
   var a, l, x = e.document,
       T = (/iPad|iPhone|iPod/.test(navigator.userAgent) || !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform)) && !e.MSStream,
       w = "ontouchstart" in e || navigator.maxTouchPoints || e.DocumentTouch && x instanceof DocumentTouch,
       O = function(e) { return !isNaN(parseFloat(e)) && isFinite(e) },
       B = function(e) { return e.stopPropagation() },
       M = function(n, a, l) { return function(e) { n && e.preventDefault(), a && e.stopPropagation(), "function" == typeof l && l() } },
       P = (a = y("head"), l = "hc-mobile-nav-style", function(e) {
           var n = a.find("style#" + l);
           n.length ? n.html(e) : y('<style id="' + l + '">' + e + "</style>").appendTo(a)
       }),
       N = function(e, n, a) {
           var l = a.children("li"),
               o = l.length,
               i = -1 < n ? Math.max(0, Math.min(n - 1, o)) : Math.max(0, Math.min(o + n + 1, o));
           0 === i ? a.prepend(e) : l.eq(i - 1).after(e)
       },
       S = 0;
   y.fn.extend({
       hcMobileNav: function(e) {
           if (!this.length) return this;
           var l, m = y.extend({}, { maxWidth: 1024, appendTo: "body", clone: !0, offCanvas: !0, side: "left", levelOpen: "overlap", levelSpacing: 40, levelTitles: !1, navTitle: null, navClass: "", disableBody: !0, closeOnClick: !0, customToggle: null, responsive: null, insertClose: !0, insertBack: !0, labelClose: "", labelBack: "" }, e),
               k = y(x.getElementsByTagName("html")[0]),
               b = (y(x), y(x.body)),
               C = (l = function(e) {
                   var n = ["Webkit", "Moz", "Ms", "O"],
                       a = (x.body || x.documentElement).style,
                       l = e.charAt(0).toUpperCase() + e.slice(1);
                   if (void 0 !== a[e]) return e;
                   for (var o = 0; o < n.length; o++)
                       if (void 0 !== a[n[o] + l]) return n[o] + l;
                   return !1
               }("transform"), function(e, n) {
                   if (l) {
                       var a = "left" === m.side ? n : -n;
                       e.css(l, "translate3d(" + a + "px,0,0)")
                   } else e.css(m.side, n)
               });
           return this.each(function() {
               var e = y(this),
                   n = void 0,
                   a = !1,
                   l = 0;
               if (e.is("ul")) n = e.clone().wrap("<nav>").parent();
               else if (e.is("nav")) n = e.clone();
else if (!(n = e.find("nav, ul").first().clone()).length) return void console.log("%c! HC MobileNav:%c There is no <nav> or
    elements in your menu.", "color: red", "color: black"); var o = n.find("ul"); if (o.length) { var p = {}, i = void 0, v = "hc-nav-" + ++S; e.addClass("hc-nav " + v), m.customToggle ? i = y(m.customToggle).addClass(v).on("click", u) : (i = y('<a class="hc-nav-trigger ' + v + '"></a>').on("click", u), e.after(i)); var r = n.children("ul").wrapAll('