mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-05 03:52:59 +00:00
7 lines
5.8 KiB
JavaScript
7 lines
5.8 KiB
JavaScript
/*!
|
|
* AdminLTE v4.0.0-alpha2 (https://adminlte.io)
|
|
* Copyright 2014-2023 Colorlib <https://colorlib.com>
|
|
* Licensed under MIT (https://github.com/ColorlibHQ/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="undefined"!=typeof globalThis?globalThis:e||self).adminlte={})}(this,(function(e){"use strict";const t=[],o=e=>{"loading"===document.readyState?(t.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of t)e()})),t.push(e)):e()},n="hold-transition";class s{constructor(e){this._element=e}holdTransition(){let e;window.addEventListener("resize",(()=>{document.body.classList.add(n),clearTimeout(e),e=setTimeout((()=>{document.body.classList.remove(n)}),400)}))}}o((()=>{new s(document.body).holdTransition(),setTimeout((()=>{document.body.classList.add("app-loaded")}),400)}));const i=".lte.push-menu",r=`open${i}`,l=`collapse${i}`,a="sidebar-mini",d="sidebar-collapse",c="sidebar-open",m="sidebar-expand",p=`[class*="${m}"]`,y='[data-lte-toggle="sidebar"]',u={sidebarBreakpoint:992};class v{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},u),t)}menusClose(){document.querySelectorAll(".nav-treeview").forEach((e=>{e.style.removeProperty("display"),e.style.removeProperty("height")}));const e=document.querySelector(".sidebar-menu"),t=null==e?void 0:e.querySelectorAll(".nav-item");t&&t.forEach((e=>{e.classList.remove("menu-open")}))}expand(){const e=new Event(r);document.body.classList.remove(d),document.body.classList.add(c),this._element.dispatchEvent(e)}collapse(){const e=new Event(l);document.body.classList.remove(c),document.body.classList.add(d),this._element.dispatchEvent(e)}addSidebarBreakPoint(){var e,t,o;const n=null!==(t=null===(e=document.querySelector(p))||void 0===e?void 0:e.classList)&&void 0!==t?t:[],s=null!==(o=Array.from(n).find((e=>e.startsWith(m))))&&void 0!==o?o:"",i=document.getElementsByClassName(s)[0],r=window.getComputedStyle(i,"::before").getPropertyValue("content");this._config=Object.assign(Object.assign({},this._config),{sidebarBreakpoint:Number(r.replace(/[^\d.-]/g,""))}),window.innerWidth<=this._config.sidebarBreakpoint?this.collapse():(document.body.classList.contains(a)||this.expand(),document.body.classList.contains(a)&&document.body.classList.contains(d)&&this.collapse())}toggle(){document.body.classList.contains(d)?this.expand():this.collapse()}init(){this.addSidebarBreakPoint()}}o((()=>{var e;const t=null===document||void 0===document?void 0:document.querySelector(".app-sidebar");if(t){const e=new v(t,u);e.init(),window.addEventListener("resize",(()=>{e.init()}))}const o=document.createElement("div");o.className="sidebar-overlay",null===(e=document.querySelector(".app-wrapper"))||void 0===e||e.append(o),o.addEventListener("touchstart",(e=>{e.preventDefault();const t=e.currentTarget;new v(t,u).collapse()})),o.addEventListener("click",(e=>{e.preventDefault();const t=e.currentTarget;new v(t,u).collapse()})),document.querySelectorAll(y).forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();let t=e.currentTarget;"sidebar"!==(null==t?void 0:t.dataset.lteToggle)&&(t=null==t?void 0:t.closest(y)),t&&(null==e||e.preventDefault(),new v(t,u).toggle())}))}))}));const g=".lte.treeview",h=`expanded${g}`,b=`collapsed${g}`,f="menu-open",w=".nav-treeview",L={animationSpeed:300};class P{constructor(e,t){this._element=e,this._config=Object.assign(Object.assign({},L),t)}open(){var e;const t=new Event(h);this._element.classList.add(f);const o=null===(e=this._element)||void 0===e?void 0:e.querySelector(w);o&&((e,t=500)=>{e.style.removeProperty("display");let{display:o}=window.getComputedStyle(e);"none"===o&&(o="block"),e.style.display=o;const n=e.offsetHeight;e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0",window.setTimeout((()=>{e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=`${t}ms`,e.style.height=`${n}px`,e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom")}),1),window.setTimeout((()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)})(o,this._config.animationSpeed),this._element.dispatchEvent(t)}close(){var e;const t=new Event(b);this._element.classList.remove(f);const o=null===(e=this._element)||void 0===e?void 0:e.querySelector(w);o&&((e,t=500)=>{e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=`${t}ms`,e.style.boxSizing="border-box",e.style.height=`${e.offsetHeight}px`,e.style.overflow="hidden",window.setTimeout((()=>{e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0"}),1),window.setTimeout((()=>{e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)})(o,this._config.animationSpeed),this._element.dispatchEvent(t)}toggle(){this._element.classList.contains(f)?this.close():this.open()}}o((()=>{document.querySelectorAll('[data-lte-toggle="treeview"]').forEach((e=>{e.addEventListener("click",(e=>{const t=e.target,o=t.closest(".nav-item"),n=t.closest(".nav-link");"#"!==(null==t?void 0:t.getAttribute("href"))&&"#"!==(null==n?void 0:n.getAttribute("href"))||e.preventDefault(),o&&new P(o,L).toggle()}))}))})),e.Layout=s,e.PushMenu=v,e.Treeview=P}));
|
|
//# sourceMappingURL=adminlte.min.js.map
|