[dark theme] hide theme's option for IE

This commit is contained in:
Maxim Kadushkin 2021-02-16 15:08:39 +03:00
parent 66ff7cf201
commit f34cb00e98
10 changed files with 21 additions and 9 deletions

View file

@ -39,6 +39,10 @@ define([
// getComputedStyle(document.documentElement).getPropertyValue('--background-normal');
},
available: function () {
return !Common.Utils.isIE;
},
current: function () {
return Common.localStorage.getItem('ui-theme', 'theme-light');
},

View file

@ -387,7 +387,6 @@ define([
this.appOptions.canFeatureComparison = !!this.api.asc_isSupportFeature("comparison");
this.appOptions.canFeatureContentControl = !!this.api.asc_isSupportFeature("content-controls");
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.canChangeUITheme = true;
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

View file

@ -313,7 +313,7 @@ define([
cls : 'btn-toolbar'
})).on('click', _on_btn_zoom.bind(me, 'up'));
if ( config.canChangeUITheme ) {
if ( Common.UI.Themes.available() ) {
var mnuitemDarkTheme = new Common.UI.MenuItem({
caption: me.header.textDarkTheme,
checked: Common.UI.Themes.isDarkTheme(),

View file

@ -244,7 +244,7 @@ define([
'<td class="right"><span id="fms-cmb-show-changes"></span></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
@ -535,6 +535,9 @@ define([
/** coauthoring end **/
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
}
},
setApi: function(o) {

View file

@ -345,7 +345,6 @@ define([
this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures;
this.appOptions.canRequestSharingSettings = this.editorConfig.canRequestSharingSettings;
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
this.appOptions.canChangeUITheme = true;
this.appOptions.user.guest && this.appOptions.canRenameAnonymous && Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

View file

@ -316,7 +316,7 @@ define([
cls : 'btn-toolbar'
})).on('click', _on_btn_zoom.bind(me, 'up'));
if ( config.canChangeUITheme ) {
if ( Common.UI.Themes.available() ) {
var mnuitemDarkTheme = new Common.UI.MenuItem({
caption: me.header.textDarkTheme,
checked: Common.UI.Themes.isDarkTheme(),

View file

@ -214,7 +214,7 @@ define([
'<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
@ -471,6 +471,10 @@ define([
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
}
},
setApi: function(o) {

View file

@ -374,7 +374,6 @@ define([
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
this.appOptions.canFeaturePivot = true;
this.appOptions.canFeatureViews = !!this.api.asc_isSupportFeature("sheet-views");
this.appOptions.canChangeUITheme = true;
if (this.appOptions.user.guest && this.appOptions.canRenameAnonymous && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge)
Common.NotificationCenter.on('user:rename', _.bind(this.showRenameUserDialog, this));

View file

@ -327,7 +327,7 @@ define([
cls : 'btn-toolbar'
})).on('click', _on_btn_zoom.bind(me, 'up'));
if ( config.canChangeUITheme ) {
if ( Common.UI.Themes.available() ) {
var mnuitemDarkTheme = new Common.UI.MenuItem({
caption: me.header.textDarkTheme,
checked: Common.UI.Themes.isDarkTheme(),

View file

@ -691,7 +691,7 @@ define([
'<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',
'</tr>','<tr class="divider coauth changes"></tr>',
/** coauthoring end **/
'<tr class="edit">',
'<tr class="themes">',
'<td class="left"><label><%= scope.strTheme %></label></td>',
'<td class="right"><span id="fms-cmb-theme"></span></td>',
'</tr>','<tr class="divider edit"></tr>',
@ -1080,6 +1080,10 @@ define([
$('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide']();
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide']();
$('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
if ( !Common.UI.Themes.available() ) {
$('tr.themes, tr.themes + tr.divider', this.el).hide();
}
},
setApi: function(api) {