bigdata-highway-analytics/App/static/assets/js/config.js
18796357645 11657ae4f5 上传
2025-03-31 20:06:02 +08:00

1 line
1.6 KiB
JavaScript

!function(){var t=sessionStorage.getItem("__POWERX_CONFIG__"),e=document.getElementsByTagName("html")[0],i={theme:"light",layout:{position:"fixed"},topbar:{color:"light"},menu:{color:"light"},sidenav:{size:"default",user:!1}},o=(this.html=document.getElementsByTagName("html")[0],config=Object.assign(JSON.parse(JSON.stringify(i)),{}),this.html.getAttribute("data-bs-theme")),o=(config.theme=null!==o?o:i.theme,this.html.getAttribute("data-layout-position")),o=(config.layout.position=null!==o?o:i.layout.position,this.html.getAttribute("data-topbar-color")),o=(config.topbar.color=null!=o?o:i.topbar.color,this.html.getAttribute("data-sidenav-size")),o=(config.sidenav.size=null!==o?o:i.sidenav.size,this.html.getAttribute("data-sidenav-user")),o=(config.sidenav.user=null!==o||i.sidenav.user,this.html.getAttribute("data-menu-color"));if(config.menu.color=null!==o?o:i.menu.color,window.defaultConfig=JSON.parse(JSON.stringify(config)),null!==t&&(config=JSON.parse(t)),window.config=config){e.setAttribute("data-bs-theme",config.theme),e.setAttribute("data-menu-color",config.menu.color),e.setAttribute("data-topbar-color",config.topbar.color),e.setAttribute("data-layout-position",config.layout.position);let t=config.sidenav.size;window.innerWidth<=767?t="full":767<=window.innerWidth&&window.innerWidth<=1140&&"full"!==self.config.sidenav.size&&"fullscreen"!==self.config.sidenav.size&&(t="condensed"),e.setAttribute("data-sidenav-size",t),config.sidenav.user&&"true"===config.sidenav.user.toString()?e.setAttribute("data-sidenav-user",!0):e.removeAttribute("data-sidenav-user")}}();