diff options
| author | Hamidreza Ghavami <hamid.r.gh.1998@gmail.com> | 2023-05-08 16:49:59 +0300 |
|---|---|---|
| committer | Hamidreza Ghavami <hamid.r.gh.1998@gmail.com> | 2023-05-08 16:49:59 +0300 |
| commit | 7d0c3b6517e6c9b8367e63400c83789c7ddab93f (patch) | |
| tree | 056e23f42b0051f6b77aa5fb92dd6ed76aa0235d /web/html/xui/common_sider.html | |
| parent | 67201fc678e51c3518097c92ab1a938100c70658 (diff) | |
remove themeChanger from siderDrawer
Diffstat (limited to 'web/html/xui/common_sider.html')
| -rw-r--r-- | web/html/xui/common_sider.html | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/web/html/xui/common_sider.html b/web/html/xui/common_sider.html index d059e920..34666b56 100644 --- a/web/html/xui/common_sider.html +++ b/web/html/xui/common_sider.html @@ -27,10 +27,7 @@ <a-menu :theme="siderDrawer.theme" mode="inline" selected-keys=""> <a-menu-item mode="inline"> <a-icon type="bg-colors"></a-icon> - <a-switch :default-checked="siderDrawer.isDarkTheme" - checked-children="☀" - un-checked-children="🌙" - @change="siderDrawer.changeTheme()"></a-switch> + <theme-switch></theme-switch> </a-menu-item> </a-menu> <a-menu :theme="siderDrawer.theme" mode="inline" :selected-keys="['{{ .request_uri }}']" @@ -49,10 +46,7 @@ <a-menu :theme="siderDrawer.theme" mode="inline" selected-keys=""> <a-menu-item mode="inline"> <a-icon type="bg-colors"></a-icon> - <a-switch :default-checked="siderDrawer.isDarkTheme" - checked-children="☀" - un-checked-children="🌙" - @change="siderDrawer.changeTheme()"></a-switch> + <theme-switch></theme-switch> </a-menu-item> </a-menu> <a-menu :theme="siderDrawer.theme" mode="inline" :selected-keys="['{{ .request_uri }}']" @@ -61,12 +55,8 @@ </a-menu> </a-drawer> <script> - const darkClass = "ant-card-dark"; - const bgDarkStyle = "background-color: #242c3a"; const siderDrawer = { visible: false, - collapsed: false, - isDarkTheme: localStorage.getItem("dark-mode") === 'false' ? false : true, show() { this.visible = true; }, @@ -76,17 +66,6 @@ change() { this.visible = !this.visible; }, - toggleCollapsed() { - this.collapsed = !this.collapsed; - }, - changeTheme() { - this.isDarkTheme = ! this.isDarkTheme; - localStorage.setItem("dark-mode", this.isDarkTheme); - }, - get theme() { - return this.isDarkTheme ? 'dark' : 'light'; - } }; - </script> {{end}} |
