[main] debug loader's theme applying

This commit is contained in:
maxkadushkin
2024-10-04 13:54:31 +03:00
parent 4e2c0eafbe
commit df989329dd

View File

@ -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");
});
}
}
}();