Skip to content

Commit

Permalink
Merge pull request #33584 from nextcloud/fix/theme-font-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Pytal authored Aug 17, 2022
2 parents 48752a9 + eb8d1ff commit 2f538bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion apps/theming/src/UserThemes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,16 @@ export default {
updateBodyAttributes() {
const enabledThemesIDs = this.themes.filter(theme => theme.enabled === true).map(theme => theme.id)
const enabledFontsIDs = this.fonts.filter(font => font.enabled === true).map(font => font.id)
this.themes.forEach(theme => {
document.body.toggleAttribute(`data-theme-${theme.id}`, theme.enabled)
})
this.fonts.forEach(font => {
document.body.toggleAttribute(`data-theme-${font.id}`, font.enabled)
})
document.body.setAttribute('data-themes', enabledThemesIDs.join(','))
document.body.setAttribute('data-themes', [...enabledThemesIDs, ...enabledFontsIDs].join(','))
},
/**
Expand Down
2 changes: 1 addition & 1 deletion apps/theming/src/components/ItemPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {
return this.selected
},
set(checked) {
console.debug('Selecting theme', this.theme, checked)
console.debug('Changed theme', this.theme.id, checked)
// If this is a radio, we can only enable
if (!this.unique) {
Expand Down
Loading

0 comments on commit 2f538bb

Please sign in to comment.