diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-05-10 16:47:48 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-05-10 23:24:06 +0200 |
commit | c59c3b5c1f8fba38d6b2e4bfd19714cb1f75ba85 (patch) | |
tree | 5ce2d8e17a8eb39f4493714a178a9164ad961840 /apps/theming | |
parent | f0f2a07f850af1105e27be5bc9180500b1dbac39 (diff) | |
download | nextcloud-server-c59c3b5c1f8fba38d6b2e4bfd19714cb1f75ba85.tar.gz nextcloud-server-c59c3b5c1f8fba38d6b2e4bfd19714cb1f75ba85.zip |
Migrate to static icons colours
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming')
-rw-r--r-- | apps/theming/src/UserThemes.vue | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/theming/src/UserThemes.vue b/apps/theming/src/UserThemes.vue index 5128e2c6c8d..ee514f049a5 100644 --- a/apps/theming/src/UserThemes.vue +++ b/apps/theming/src/UserThemes.vue @@ -100,13 +100,12 @@ export default { this.themes.forEach(theme => { if (theme.id === id && enabled) { theme.enabled = true - document.body.setAttribute(`data-theme-${theme.id}`, true) return } theme.enabled = false - document.body.removeAttribute(`data-theme-${theme.id}`) }) + this.updateBodyAttributes() this.selectItem(enabled, id) }, changeFont({ enabled, id }) { @@ -114,16 +113,24 @@ export default { this.fonts.forEach(font => { if (font.id === id && enabled) { font.enabled = true - document.body.setAttribute(`data-theme-${font.id}`, true) return } font.enabled = false - document.body.removeAttribute(`data-theme-${font.id}`) }) + this.updateBodyAttributes() this.selectItem(enabled, id) }, + updateBodyAttributes() { + const enabledThemesIDs = this.themes.filter(theme => theme.enabled === true).map(theme => theme.id) + this.themes.forEach(theme => { + document.body.toggleAttribute(`data-theme-${theme.id}`, theme.enabled) + }) + + document.body.setAttribute('data-themes', enabledThemesIDs.join(',')) + }, + /** * Commit a change and force reload css * Fetching the file again will trigger the server update |