mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-13 19:37:42 +01:00
Fixes setting theme from account (#2939)
* getting there * working * make
This commit is contained in:
parent
10c60291d2
commit
90dd3cc73a
2 changed files with 9 additions and 11 deletions
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -588,6 +588,7 @@ window.windowMixin = {
|
|||
changeTheme(newValue) {
|
||||
document.body.setAttribute('data-theme', newValue)
|
||||
if (this.themeSelection) {
|
||||
this.themeChoice = newValue
|
||||
this.$q.localStorage.set('lnbits.theme', newValue)
|
||||
}
|
||||
this.setColors()
|
||||
|
@ -596,13 +597,11 @@ window.windowMixin = {
|
|||
darkBgColor = this.$q.localStorage.getItem('lnbits.darkBgColor')
|
||||
primaryColor = this.$q.localStorage.getItem('lnbits.primaryColor')
|
||||
if (this.gradientChoice) {
|
||||
this.$q.localStorage.set('lnbits.gradientBg', true)
|
||||
if (!this.$q.dark.isActive) {
|
||||
this.$q.dark.toggle()
|
||||
this.$q.localStorage.set('lnbits.darkMode', true)
|
||||
}
|
||||
if (this.gradientSelection) {
|
||||
this.$q.localStorage.set('lnbits.gradientBg', true)
|
||||
}
|
||||
const gradientStyle = `linear-gradient(to bottom right, ${LNbits.utils.hexDarken(String(primaryColor), -70)}, #0a0a0a)`
|
||||
document.body.style.setProperty(
|
||||
'background-image',
|
||||
|
@ -617,15 +616,15 @@ window.windowMixin = {
|
|||
`[data-theme="${this.themeChoice}"] .q-card--dark{background: ${String(darkBgColor)} !important;} }`
|
||||
document.head.appendChild(style)
|
||||
} else {
|
||||
if (this.gradientSelection) {
|
||||
this.$q.localStorage.set('lnbits.gradientBg', false)
|
||||
}
|
||||
this.$q.localStorage.set('lnbits.gradientBg', false)
|
||||
}
|
||||
},
|
||||
toggleDarkMode() {
|
||||
this.$q.dark.toggle()
|
||||
this.$q.localStorage.set('lnbits.darkMode', this.$q.dark.isActive)
|
||||
if (this.gradientChoice && !this.$q.dark.isActive) {
|
||||
this.$q.localStorage.set('lnbits.gradientBg', false)
|
||||
this.$q.localStorage.remove(`lnbits.backgroundImage`)
|
||||
window.location.reload()
|
||||
}
|
||||
},
|
||||
|
@ -640,12 +639,11 @@ window.windowMixin = {
|
|||
if (
|
||||
this.bgimageChoice &&
|
||||
this.bgimageChoice !== 'null' &&
|
||||
this.bgimageChoice !== 'none' &&
|
||||
this.bgimageChoice !== ''
|
||||
) {
|
||||
if (!this.gradientChoice) {
|
||||
this.gradientChoice = true
|
||||
this.applyGradient()
|
||||
}
|
||||
this.gradientChoice = true
|
||||
this.applyGradient()
|
||||
const style = document.createElement('style')
|
||||
style.innerHTML = `
|
||||
body[data-theme="${this.themeChoice}"]::before {
|
||||
|
|
Loading…
Add table
Reference in a new issue