You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
7.9 KiB

2 years ago
  1. /** layui-v2.1.5 MIT License By http://www.layui.com */
  2. ; layui.define("jquery", function (i) { "use strict"; var a = layui.$, t = (layui.hint(), layui.device()), l = "element", e = "layui-this", n = "layui-show", s = function () { this.config = {} }; s.prototype.set = function (i) { var t = this; return a.extend(!0, t.config, i), t }, s.prototype.on = function (i, a) { return layui.onevent.call(this, l, i, a) }, s.prototype.tabAdd = function (i, t) { var l = ".layui-tab-title", e = a(".layui-tab[lay-filter=" + i + "]"), n = e.children(l), s = n.children(".layui-tab-bar"), o = e.children(".layui-tab-content"), c = '<li lay-id="' + (t.id || "") + '">' + (t.title || "unnaming") + "</li>"; return s[0] ? s.before(c) : n.append(c), o.append('<div class="layui-tab-item">' + (t.content || "") + "</div>"), y.hideTabMore(!0), y.tabAuto(), this }, s.prototype.tabDelete = function (i, t) { var l = ".layui-tab-title", e = a(".layui-tab[lay-filter=" + i + "]"), n = e.children(l), s = n.find('>li[lay-id="' + t + '"]'); return y.tabDelete(null, s), this }, s.prototype.tabChange = function (i, t) { var l = ".layui-tab-title", e = a(".layui-tab[lay-filter=" + i + "]"), n = e.children(l), s = n.find('>li[lay-id="' + t + '"]'); return y.tabClick(null, null, s), this }, s.prototype.progress = function (i, t) { var l = "layui-progress", e = a("." + l + "[lay-filter=" + i + "]"), n = e.find("." + l + "-bar"), s = n.find("." + l + "-text"); return n.css("width", t), s.text(t), this }; var o = ".layui-nav", c = "layui-nav-item", r = "layui-nav-bar", u = "layui-nav-tree", d = "layui-nav-child", h = "layui-nav-more", f = "layui-anim layui-anim-upbit", y = { tabClick: function (i, t, s) { var o = s || a(this), t = t || o.parent().children("li").index(o), c = o.parents(".layui-tab").eq(0), r = c.children(".layui-tab-content").children(".layui-tab-item"), u = o.find("a"), d = c.attr("lay-filter"); "javascript:;" !== u.attr("href") && "_blank" === u.attr("target") || (o.addClass(e).siblings().removeClass(e), r.eq(t).addClass(n).siblings().removeClass(n)), layui.event.call(this, l, "tab(" + d + ")", { elem: c, index: t }) }, tabDelete: function (i, t) { var l = t || a(this).parent(), n = l.index(), s = l.parents(".layui-tab").eq(0), o = s.children(".layui-tab-content").children(".layui-tab-item"); l.hasClass(e) && (l.next()[0] ? y.tabClick.call(l.next()[0], null, n + 1) : l.prev()[0] && y.tabClick.call(l.prev()[0], null, n - 1)), l.remove(), o.eq(n).remove(), setTimeout(function () { y.tabAuto() }, 50) }, tabAuto: function () { var i = "layui-tab-more", l = "layui-tab-bar", e = "layui-tab-close", n = this; a(".layui-tab").each(function () { var s = a(this), o = s.children(".layui-tab-title"), c = (s.children(".layui-tab-content").children(".layui-tab-item"), 'lay-stope="tabmore"'), r = a('<span class="layui-unselect layui-tab-bar" ' + c + "><i " + c + ' class="layui-icon">&#xe61a;</i></span>'); if (n === window && 8 != t.ie && y.hideTabMore(!0), s.attr("lay-allowClose") && o.find("li").each(function () { var i = a(this); if (!i.find("." + e)[0]) { var t = a('<i class="layui-icon layui-unselect ' + e + '">&#x1006;</i>'); t.on("click", y.tabDelete), i.append(t) } }), o.prop("scrollWidth") > o.outerWidth() + 1) { if (o.find("." + l)[0]) return; o.append(r), s.attr("overflow", ""), r.on("click", function (a) { o[this.title ? "removeClass" : "addClass"](i), this.title = this.title ? "" : "收缩" }) } else o.find("." + l).remove(), s.removeAttr("overflow") }) }, hideTabMore: function (i) { var t = a(".layui-tab-title"); i !== !0 && "tabmore" === a(i.target).attr("lay-stope") || (t.removeClass("layui-tab-more"), t.find(".layui-tab-bar").attr("title", "")) }, clickThis: function () { var i = a(this), t = i.parents(o), n = t.attr("lay-filter"), s = i.find("a"); i.find("." + d)[0] || ("javascript:;" !== s.attr("href") && "_blank" === s.attr("target") || (t.find("." + e).removeClass(e), i.addClass(e)), layui.event.call(this, l, "nav(" + n + ")", i)) }, clickChild: function () { var i = a(this), t = i.parents(o), n = t.attr("lay-filter"); t.find("." + e).removeClass(e), i.addClass(e), layui.event.call(this, l, "nav(