Starting theme support
This commit is contained in:
parent
c3b392abce
commit
09b8960038
6 changed files with 65 additions and 11 deletions
|
@ -586,6 +586,7 @@ const app = new Vue({
|
|||
},
|
||||
async init() {
|
||||
let self = this
|
||||
this.setTheme()
|
||||
this.setLz(this.cfg.general.language)
|
||||
this.setLzManual()
|
||||
clearTimeout(this.hangtimer)
|
||||
|
@ -840,6 +841,18 @@ const app = new Vue({
|
|||
this.$forceUpdate()
|
||||
}, 500)
|
||||
},
|
||||
setTheme(theme = "") {
|
||||
if(this.cfg.visual.theme == "") {
|
||||
this.cfg.visual.theme = "default.less"
|
||||
}
|
||||
if(theme == ""){
|
||||
theme = this.cfg.visual.theme
|
||||
}else{
|
||||
this.cfg.visual.theme = theme
|
||||
}
|
||||
document.querySelector("#userTheme").href = `themes/${this.cfg.visual.theme}`
|
||||
document.querySelectorAll(`[id*='less']`).forEach(el => { el.remove() });less.refresh()
|
||||
},
|
||||
unauthorize() {
|
||||
this.mk.unauthorize()
|
||||
document.location.reload()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue