Merge pull request #1233 from ONLYOFFICE/feature/hide-darkmode-for-pdf
[DE] hide "Dark mode" button for some formats
This commit is contained in:
commit
12bce4a93a
|
@ -565,7 +565,9 @@ define([
|
|||
if ( !!window.DE ) {
|
||||
var mode_cls = Common.UI.Themes.isContentThemeDark() ? 'btn-mode-light' : 'btn-mode-dark';
|
||||
me.btnContentMode = createTitleButton('toolbar__icon icon--inverse ' + mode_cls, $html.findById('#slot-btn-mode'), undefined, 'bottom', 'big');
|
||||
me.btnContentMode.setVisible(Common.UI.Themes.isDarkTheme());
|
||||
|
||||
var document = window.DE.getController('Main').document;
|
||||
me.btnContentMode.setVisible(Common.UI.Themes.isDarkTheme() && !/^pdf|djvu|xps|oxps$/.test(document.fileType));
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
|
|
@ -325,7 +325,8 @@ define([
|
|||
})).on('click', _on_btn_zoom.bind(me, 'up'));
|
||||
|
||||
me.header.btnOptions.menu.on('item:click', me.onOptionsItemClick.bind(this));
|
||||
if ( !Common.UI.Themes.isDarkTheme() ) {
|
||||
var document = DE.getController('Main').document;
|
||||
if ( !Common.UI.Themes.isDarkTheme() || /^pdf|djvu|xps|oxps$/.test(document.fileType) ) {
|
||||
me.header.menuItemsDarkMode.hide();
|
||||
me.header.menuItemsDarkMode.$el.prev('.divider').hide();
|
||||
}
|
||||
|
@ -370,13 +371,16 @@ define([
|
|||
},
|
||||
|
||||
onThemeChanged: function (id) {
|
||||
var current_dark = Common.UI.Themes.isDarkTheme();
|
||||
var menuItem = this.header.menuItemsDarkMode;
|
||||
menuItem.setVisible(current_dark);
|
||||
menuItem.$el.prev('.divider')[current_dark ? 'show' : 'hide']();
|
||||
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']();
|
||||
|
||||
menuItem.setChecked(current_dark);
|
||||
this.header.btnContentMode.setVisible(current_dark);
|
||||
menuItem.setChecked(current_dark);
|
||||
this.header.btnContentMode.setVisible(current_dark);
|
||||
}
|
||||
},
|
||||
|
||||
onContentThemeChangedToDark: function (isdark) {
|
||||
|
|
Loading…
Reference in a new issue