[desktop] fixed theme initialization on app launch
This commit is contained in:
parent
938e916508
commit
2c5e17fd0c
|
@ -345,6 +345,7 @@ define([
|
|||
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
|
||||
document.body.classList.add(id, 'theme-type-' + themes_map[id].type);
|
||||
|
||||
if ( this.api ) {
|
||||
if ( this.api.asc_setContentDarkMode )
|
||||
if ( themes_map[id].type == 'light' ) {
|
||||
this.api.asc_setContentDarkMode(false);
|
||||
|
@ -353,7 +354,6 @@ define([
|
|||
Common.NotificationCenter.trigger('contenttheme:dark', this.isContentThemeDark());
|
||||
}
|
||||
|
||||
if ( this.api ) {
|
||||
var obj = get_current_theme_colors(name_colors);
|
||||
obj.type = themes_map[id].type;
|
||||
obj.name = id;
|
||||
|
|
|
@ -56,13 +56,14 @@ if ( window.desktop && !!window.RendererProcessVariable ) {
|
|||
var theme = window.RendererProcessVariable.theme
|
||||
|
||||
if ( theme ) {
|
||||
if ( !theme.id && !!theme.type ) {
|
||||
if ( theme.type == 'dark' ) theme.id = 'theme-dark'; else
|
||||
if ( theme.type == 'light' ) theme.id = 'theme-classic-light';
|
||||
}
|
||||
|
||||
if ( theme.id ) {
|
||||
// params.uitheme = undefined;
|
||||
localStorage.setItem("ui-theme-id", theme.id);
|
||||
} else
|
||||
if ( !!theme.type ) {
|
||||
if ( theme.type == 'dark' ) params.uitheme = 'default-dark'; else
|
||||
if ( theme.type == 'light' ) params.uitheme = 'default-light';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue