adminlte.min.js 9.6 KB
Newer Older
A
Abdullah Almsaeed 已提交
1
/*!
2
 * AdminLTE v3.0.0-beta.1 (https://adminlte.io)
J
Jorge Vilaça 已提交
3
 * Copyright 2014-2019 Abdullah Almsaeed <abdullah@almsaeedstudio.com>
A
Abdullah Almsaeed 已提交
4 5
 * Licensed under MIT (https://github.com/almasaeed2010/AdminLTE/blob/master/LICENSE)
 */
6
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.adminlte={})}(this,function(e){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i,t,o,r,s,a,l,c,f,d,h,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p=(i=jQuery,t="ControlSidebar",o="lte.control.sidebar",r=i.fn[t],s=".control-sidebar",a='[data-widget="control-sidebar"]',l=".main-header",c="control-sidebar-open",f="control-sidebar-slide-open",d={slide:!0},g.prototype.show=function(){this._config.slide?i("body").removeClass(f):i("body").removeClass(c)},g.prototype.collapse=function(){this._config.slide?i("body").addClass(f):i("body").addClass(c)},g.prototype.toggle=function(){this._setMargin(),i("body").hasClass(c)||i("body").hasClass(f)?this.show():this.collapse()},g.prototype._getConfig=function(e){return i.extend({},d,e)},g.prototype._setMargin=function(){i(s).css({top:i(l).innerHeight()})},g._jQueryInterface=function(t){return this.each(function(){var e=i(this).data(o);if(e||(e=new g(this,i(this).data()),i(this).data(o,e)),"undefined"===e[t])throw new Error(t+" is not a function");e[t]()})},h=g,i(document).on("click",a,function(e){e.preventDefault(),h._jQueryInterface.call(i(this),"toggle")}),i.fn[t]=h._jQueryInterface,i.fn[t].Constructor=h,i.fn[t].noConflict=function(){return i.fn[t]=r,h._jQueryInterface},h);function g(e,t){n(this,g),this._element=e,this._config=this._getConfig(t)}var y,_,m,v,b,w,C,S,j,E,D,x,Q,I,A,L,O=(y=jQuery,_="Layout",m="lte.layout",v=y.fn[_],b=".main-header",w=".main-sidebar .sidebar",C=".content-wrapper",S=".brand-link",j=".control-sidebar",E=".main-footer",D="hold-transition",x="layout-fixed",Q="layout-navbar-fixed",I="layout-footer-fixed",A={scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l"},P.prototype.fixLayoutHeight=function(){var e={window:y(window).height(),header:y(b).outerHeight(),footer:y(E).outerHeight(),sidebar:y(w).height()},t=this._max(e);y("body").hasClass(x)?(y(C).css("min-height",t-e.header-e.footer),y(j+" .control-sidebar-content").css("height",t-e.header),"undefined"!=typeof y.fn.overlayScrollbars&&(y(w).overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}),y(j+" .control-sidebar-content").overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}))):e.sidebar<e.window?y(C).css("min-height",e.window-e.header-e.footer):y(C).css("min-height",e.sidebar-e.header),y("body").hasClass(Q)&&(y(S).css("height",e.header),y(w).css("margin-top",e.header),y(w).css("margin-top",e.header)),y("body").hasClass(I)&&y(C).css("margin-bottom",e.footer)},P.prototype._init=function(){var e=this;y("body").removeClass(D),this.fixLayoutHeight(),y(w).on("collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu",function(){e.fixLayoutHeight()}),y(window).resize(function(){e.fixLayoutHeight()}),y("body, html").css("height","auto")},P.prototype._max=function(t){var n=0;return Object.keys(t).forEach(function(e){t[e]>n&&(n=t[e])}),n},P._jQueryInterface=function(n){return this.each(function(){var e=y(this).data(m),t=y.extend({},A,y(this).data());e||(e=new P(y(this),t),y(this).data(m,e)),"init"===n&&e[n]()})},L=P,y(window).on("load",function(){L._jQueryInterface.call(y("body"))}),y.fn[_]=L._jQueryInterface,y.fn[_].Constructor=L,y.fn[_].noConflict=function(){return y.fn[_]=v,L._jQueryInterface},L);function P(e,t){n(this,P),this._config=t,this._element=e,this._init()}var T,H,k,z,N,M,U,W,X,R,V,q,B,F,G=(T=jQuery,H="PushMenu",z="."+(k="lte.pushmenu"),N=T.fn[H],U={autoCollapseSize:!(M={COLLAPSED:"collapsed"+z,SHOWN:"shown"+z}),screenCollapseSize:768},W='[data-widget="pushmenu"]',X="body",R="#sidebar-overlay",V=".wrapper",q="sidebar-collapse",B="sidebar-open",J.prototype.show=function(){T(X).addClass(B).removeClass(q);var e=T.Event(M.SHOWN);T(this._element).trigger(e)},J.prototype.collapse=function(){T(X).removeClass(B).addClass(q);var e=T.Event(M.COLLAPSED);T(this._element).trigger(e)},J.prototype.isShown=function(){return T(window).width()>=this._options.screenCollapseSize?!T(X).hasClass(q):T(X).hasClass(B)},J.prototype.toggle=function(){this.isShown()?this.collapse():this.show()},J.prototype.autoCollapse=function(){console.log(this._options),this._options.autoCollapseSize&&(T(window).width()<=this._options.autoCollapseSize?this.isShown()&&this.toggle():this.isShown()||this.toggle())},J.prototype._init=function(){var e=this;this.autoCollapse(),T(window).resize(function(){e.autoCollapse()})},J.prototype._addOverlay=function(){var e=this,t=T("<div />",{id:"sidebar-overlay"});t.on("click",function(){e.collapse()}),T(V).append(t)},J._jQueryInterface=function(n){return this.each(function(){var e=T(this).data(k),t=T.extend({},U,T(this).data());e||(e=new J(this,t),T(this).data(k,e)),"init"===n&&e[n]()})},F=J,T(document).on("click",W,function(e){e.preventDefault();var t=e.currentTarget;"pushmenu"!==T(t).data("widget")&&(t=T(t).closest(W)),F._jQueryInterface.call(T(t),"toggle")}),T(window).on("load",function(){F._jQueryInterface.call(T(W))}),T.fn[H]=F._jQueryInterface,T.fn[H].Constructor=F,T.fn[H].noConflict=function(){return T.fn[H]=N,F._jQueryInterface},F);function J(e,t){n(this,J),this._element=e,this._options=T.extend({},U,t),this._init(),T(R).length||this._addOverlay()}var K,Y,Z,$,ee,te,ne,ie,oe,re,se,ae,le,ce=(K=jQuery,Y="Treeview",$="."+(Z="lte.treeview"),ee=K.fn[Y],te={SELECTED:"selected"+$,EXPANDED:"expanded"+$,COLLAPSED:"collapsed"+$,LOAD_DATA_API:"load"+$},ne=".nav-item",ie=".nav-treeview",oe=".menu-open",se="menu-open",ae={trigger:(re='[data-widget="treeview"]')+" "+".nav-link",animationSpeed:300,accordion:!0},fe.prototype.init=function(){this._setupListeners()},fe.prototype.expand=function(e,t){var n=this,i=K.Event(te.EXPANDED);if(this._config.accordion){var o=t.siblings(oe).first(),r=o.find(ie).first();this.collapse(r,o)}e.slideDown(this._config.animationSpeed,function(){t.addClass(se),K(n._element).trigger(i)})},fe.prototype.collapse=function(e,t){var n=this,i=K.Event(te.COLLAPSED);e.slideUp(this._config.animationSpeed,function(){t.removeClass(se),K(n._element).trigger(i),e.find(oe+" > "+ie).slideUp(),e.find(oe).removeClass(se)})},fe.prototype.toggle=function(e){var t=K(e.currentTarget),n=t.next();if(n.is(ie)){e.preventDefault();var i=t.parents(ne).first();i.hasClass(se)?this.collapse(K(n),i):this.expand(K(n),i)}},fe.prototype._setupListeners=function(){var t=this;K(document).on("click",this._config.trigger,function(e){t.toggle(e)})},fe._jQueryInterface=function(n){return this.each(function(){var e=K(this).data(Z),t=K.extend({},ae,K(this).data());e||(e=new fe(K(this),t),K(this).data(Z,e)),"init"===n&&e[n]()})},le=fe,K(window).on(te.LOAD_DATA_API,function(){K(re).each(function(){le._jQueryInterface.call(K(this),"init")})}),K.fn[Y]=le._jQueryInterface,K.fn[Y].Constructor=le,K.fn[Y].noConflict=function(){return K.fn[Y]=ee,le._jQueryInterface},le);function fe(e,t){n(this,fe),this._config=t,this._element=e}var de,he,ue,pe,ge,ye,_e,me,ve,be,we,Ce,Se,je,Ee,De,xe,Qe,Ie=(de=jQuery,he="Widget",pe="."+(ue="lte.widget"),ge=de.fn[he],ye={EXPANDED:"expanded"+pe,COLLAPSED:"collapsed"+pe,REMOVED:"removed"+pe},ve=".card",be=".card-body",we=".card-footer",Ce=".fa-minus",Se=".fa-plus",je="collapsed-card",Ee="fa-minus",De="fa-plus",xe={animationSpeed:"normal",collapseTrigger:me='[data-widget="collapse"]',removeTrigger:_e='[data-widget="remove"]'},Ae.prototype.collapse=function(){var e=this;this._parent.children(be+", "+we).slideUp(this._settings.animationSpeed,function(){e._parent.addClass(je)}),this._element.children(Ce).addClass(De).removeClass(Ee);var t=de.Event(ye.COLLAPSED);this._element.trigger(t,this._parent)},Ae.prototype.expand=function(){var e=this;this._parent.children(be+", "+we).slideDown(this._settings.animationSpeed,function(){e._parent.removeClass(je)}),this._element.children(Se).addClass(Ee).removeClass(De);var t=de.Event(ye.EXPANDED);this._element.trigger(t,this._parent)},Ae.prototype.remove=function(){this._parent.slideUp();var e=de.Event(ye.REMOVED);this._element.trigger(e,this._parent)},Ae.prototype.toggle=function(){this._parent.hasClass(je)?this.expand():this.collapse()},Ae.prototype._init=function(e){var t=this;this._parent=e,de(this).find(this._settings.collapseTrigger).click(function(){t.toggle()}),de(this).find(this._settings.removeTrigger).click(function(){t.remove()})},Ae._jQueryInterface=function(t){return this.each(function(){var e=de(this).data(ue);e||(e=new Ae(de(this),e),de(this).data(ue,"string"==typeof t?e:t)),"string"==typeof t&&t.match(/remove|toggle/)?e[t]():"object"===("undefined"==typeof t?"undefined":u(t))&&e._init(de(this))})},Qe=Ae,de(document).on("click",me,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(de(this),"toggle")}),de(document).on("click",_e,function(e){e&&e.preventDefault(),Qe._jQueryInterface.call(de(this),"remove")}),de.fn[he]=Qe._jQueryInterface,de.fn[he].Constructor=Qe,de.fn[he].noConflict=function(){return de.fn[he]=ge,Qe._jQueryInterface},Qe);function Ae(e,t){n(this,Ae),this._element=e,this._parent=e.parents(ve).first(),this._settings=de.extend({},xe,t)}e.ControlSidebar=p,e.Layout=O,e.PushMenu=G,e.Treeview=ce,e.Widget=Ie,Object.defineProperty(e,"__esModule",{value:!0})});
A
Abdullah Almsaeed 已提交
7
//# sourceMappingURL=adminlte.min.js.map