🚧 WIP - working on the custom theme feature

This commit is contained in:
Alicia Sykes
2021-07-11 20:52:12 +01:00
parent c7d91bed94
commit 65aa971099
11 changed files with 142 additions and 35 deletions

View File

@@ -9,7 +9,8 @@
import SideBar from '@/components/Workspace/SideBar';
import WebContent from '@/components/Workspace/WebContent';
import Defaults, { localStorageKeys } from '@/utils/defaults';
import Defaults from '@/utils/defaults';
import { ApplyLocalTheme, GetTheme } from '@/utils/ThemeHelper';
export default {
name: 'Workspace',
@@ -19,6 +20,8 @@ export default {
},
data: () => ({
url: '', // this.$route.query.url || '',
GetTheme,
ApplyLocalTheme,
}),
components: {
SideBar,
@@ -29,10 +32,7 @@ export default {
this.url = url;
},
setTheme() {
const theme = localStorage[localStorageKeys.THEME] || this.confTheme || Defaults.theme;
const htmlTag = document.getElementsByTagName('html')[0];
if (htmlTag.hasAttribute('data-theme')) htmlTag.removeAttribute('data-theme');
htmlTag.setAttribute('data-theme', theme);
this.ApplyLocalTheme(this.GetTheme());
},
initiateFontAwesome() {
const fontAwesomeScript = document.createElement('script');