[desktop] fix bug 53610
This commit is contained in:
parent
33c511c432
commit
ffbf529fe8
|
@ -255,7 +255,9 @@ define([
|
|||
|
||||
$(window).on('storage', function (e) {
|
||||
if ( e.key == 'ui-theme' || e.key == 'ui-theme-id' ) {
|
||||
me.setTheme(e.originalEvent.newValue, true);
|
||||
if ( !!t.originalEvent.newValue ) {
|
||||
me.setTheme(t.originalEvent.newValue, true);
|
||||
}
|
||||
} else
|
||||
if ( e.key == 'content-theme' ) {
|
||||
me.setContentTheme(e.originalEvent.newValue, true);
|
||||
|
@ -371,6 +373,8 @@ define([
|
|||
},
|
||||
|
||||
setTheme: function (obj, force) {
|
||||
if ( !obj ) return;
|
||||
|
||||
var id = get_ui_theme_name(obj);
|
||||
if ( (this.currentThemeId() != id || force) && !!themes_map[id] ) {
|
||||
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
|
||||
|
|
|
@ -372,12 +372,14 @@ define([
|
|||
onThemeChanged: function (id) {
|
||||
var document = DE.getController('Main').document;
|
||||
if ( !/^pdf|djvu|xps|oxps$/.test(document.fileType) ) {
|
||||
var current_dark = Common.UI.Themes.isDarkTheme();
|
||||
var menuItem = this.header.menuItemsDarkMode;
|
||||
menuItem.setVisible(current_dark);
|
||||
menuItem.$el.prev('.divider')[current_dark ? 'show' : 'hide']();
|
||||
if ( this.header.menuItemsDarkMode ) {
|
||||
var current_dark = Common.UI.Themes.isDarkTheme();
|
||||
var menuItem = this.header.menuItemsDarkMode;
|
||||
menuItem.setVisible(current_dark);
|
||||
menuItem.$el.prev('.divider')[current_dark ? 'show' : 'hide']();
|
||||
|
||||
menuItem.setChecked(Common.UI.Themes.isContentThemeDark());
|
||||
menuItem.setChecked(Common.UI.Themes.isContentThemeDark());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue