This commit is contained in:
Peter Maquiran
2022-10-21 15:40:14 +01:00
parent a0c55a2dc0
commit 6cd8b1f058
3 changed files with 14 additions and 6 deletions
+4 -4
View File
@@ -13,7 +13,8 @@ export class ThemeService {
'doneIt'
]
currentTheme: 'gov' | 'default' | 'doneIt' = 'gov'
private defaultTheme: any = 'doneIt'
currentTheme: 'gov' | 'default' | 'doneIt' = this.defaultTheme
keyName: string
constructor(
@@ -22,19 +23,18 @@ export class ThemeService {
this.keyName = (SHA1(this.constructor.name)).toString()
let restore = localstoreService.get(this.keyName, {
theme: "gov"
theme: this.defaultTheme
})
this.setTheme(restore.theme)
}
setTheme(theme: 'gov' | 'default') {
setTheme(theme: 'gov' | 'default' | 'doneIt') {
if(this.themes.includes(theme)) {
document.body.classList.remove("gov");
document.body.classList.remove("default");
document.body.classList.remove("tribunal");
document.body.classList.remove("doneIt");
document.body.classList.add(theme);