🚧 WIP - working on the custom theme feature
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user