Skip to content

Commit

Permalink
Merge pull request 'release/v8.2.0' (#62) from release/v8.2.0 into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
Julia Radzhabova committed Oct 4, 2024
2 parents a7d9f41 + df98932 commit 2b6d679
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions apps/common/main/lib/util/themeinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@
'--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 )
{
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");
Expand All @@ -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");
});
}
}
}();

0 comments on commit 2b6d679

Please sign in to comment.