From df989329ddbbbf28fed659444533f9f8068346bc Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Fri, 4 Oct 2024 13:54:31 +0300 Subject: [PATCH] [main] debug loader's theme applying --- apps/common/main/lib/util/themeinit.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/util/themeinit.js b/apps/common/main/lib/util/themeinit.js index 1b0db3d380..e2ba2f5fd8 100644 --- a/apps/common/main/lib/util/themeinit.js +++ b/apps/common/main/lib/util/themeinit.js @@ -90,6 +90,7 @@ '--toolbar-header-presentation: #1e1e1e; --toolbar-header-pdf: #1e1e1e;}'); let objtheme = window.uitheme.colors ? window.uitheme : localstorage.getItem("ui-theme"); + const header_tokens = ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf']; if ( !!objtheme ) { if ( typeof(objtheme) == 'string' && objtheme.lastIndexOf("{", 0) === 0 && objtheme.indexOf("}", objtheme.length - 1) !== -1 ) @@ -97,7 +98,6 @@ objtheme = JSON.parse(objtheme); } - const header_tokens = ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf']; if ( objtheme ) { if ( window.uitheme.id && window.uitheme.id != objtheme.id ) { local_storage_available && localstorage.removeItem("ui-theme"); @@ -121,12 +121,12 @@ inject_style_tag('.' + objtheme.id + '{' + colors.join(';') + ';}'); } } - } else { - if ( window.uitheme.id.lastIndexOf("theme-gray", 0) === 0 ) { - header_tokens.forEach(function (i) { - !!document.documentElement.style.setProperty('--' + i, "#f7f7f7"); - }); - } + } + } else { + if ( window.uitheme.id.lastIndexOf("theme-gray", 0) === 0 ) { + header_tokens.forEach(function (i) { + !!document.documentElement.style.setProperty('--' + i, "#f7f7f7"); + }); } } }();