AdminLTE/dist/js/adminlte.min.js
REJack 94d37b5520
reworked control-sidebar & removed overflow from wrapper and html
- added display none/block to control-sidebar to avoid sidewards scrolling
- reworked ControlSidebar.js with queue to add and remove .control-sidebar-animate from html to avoid overflow
2019-07-10 16:02:33 +02:00

7 lines
11 KiB
JavaScript

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