diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 7ea7f1416..178cef62f 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -325,8 +325,7 @@ define([ })).on('click', _on_btn_zoom.bind(me, 'up')); me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this)); - var document = DE.getController('Main').document; - if ( !Common.UI.Themes.isDarkTheme() || /^pdf|djvu|xps|oxps$/.test(document.fileType) ) { + if ( !Common.UI.Themes.isDarkTheme() ) { me.header.menuItemsDarkMode.hide(); me.header.menuItemsDarkMode.$el.prev('.divider').hide(); } @@ -371,16 +370,13 @@ define([ }, onThemeChanged: function (id) { - var document = DE.getController('Main').document; - if ( !/^pdf|djvu|xps|oxps$/.test(document.fileType) ) { - 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'](); + 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()); } }, diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 22b12c722..bdc194e7a 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -648,7 +648,6 @@ define([ if ( !Common.UI.Themes.available() ) { $('tr.themes, tr.themes + tr.divider', this.el).hide(); } - this.chDarkMode.setVisible(!/^pdf|djvu|xps|oxps$/.test(DE.getController('Main').document.fileType)); }, setApi: function(o) {