From 551d435f898d764ec190fc445ca45c0c0eb4fdb7 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 18 Aug 2020 14:11:02 +0200 Subject: Make it possible to define theme header styling per background MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/dashboard/src/App.vue | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'apps/dashboard/src') diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue index c59e4732373..a2cccfce3ff 100644 --- a/apps/dashboard/src/App.vue +++ b/apps/dashboard/src/App.vue @@ -4,8 +4,9 @@
+ :key="status"> +
+
{ this.timer = new Date() }, 30000) @@ -268,31 +272,26 @@ export default { updateBackground(data) { this.background = data.type === 'custom' || data.type === 'default' ? data.type : data.value this.version = data.version + this.updateGlobalStyles() + }, + updateGlobalStyles() { + if (window.OCA.Theming.inverted) { + document.body.classList.add('dashboard-inverted') + } + + const shippedBackgroundTheme = shippedBackgroundList[this.background] ? shippedBackgroundList[this.background].theming : 'light' + if (shippedBackgroundTheme === 'dark') { + document.body.classList.add('dashboard-dark') + } else { + document.body.classList.remove('dashboard-dark') + } }, }, }