mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 21:58:09 +08:00
[main] debug loader's theme applying
This commit is contained in:
@ -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");
|
||||
});
|
||||
}
|
||||
}
|
||||
}();
|
||||
|
||||
Reference in New Issue
Block a user