[all] fix bug 49030

This commit is contained in:
Maxim Kadushkin 2021-03-12 00:16:19 +03:00
parent a214a9d75b
commit ecc19e0c62
4 changed files with 13 additions and 10 deletions

View file

@ -18,6 +18,9 @@ define([
}
return {
THEME_LIGHT_ID: 'theme-light',
THEME_DARK_ID: 'theme-dark',
init: function (api) {
var me = this;
$(window).on('storage', function (e) {
@ -49,7 +52,7 @@ define([
},
current: function () {
return Common.localStorage.getItem('ui-theme', 'theme-light');
return Common.localStorage.getItem('ui-theme') || 'theme-light';
},
isDarkTheme: function () {

View file

@ -465,8 +465,8 @@ define([
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
{ value: Common.UI.Themes.THEME_LIGHT_ID, displayValue: this.txtThemeLight },
{ value: Common.UI.Themes.THEME_DARK_ID, displayValue: this.txtThemeDark }
]
});
@ -601,7 +601,7 @@ define([
this.chPaste.setValue(Common.Utils.InternalSettings.get("de-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
this.cmbTheme.setValue(item ? item.get('value') : Common.UI.Themes.THEME_LIGHT_ID);
},
applySettings: function() {

View file

@ -404,8 +404,8 @@ define([
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
{ value: Common.UI.Themes.THEME_LIGHT_ID, displayValue: this.txtThemeLight },
{ value: Common.UI.Themes.THEME_DARK_ID, displayValue: this.txtThemeDark }
]
});
@ -530,7 +530,7 @@ define([
this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
this.cmbTheme.setValue(item ? item.get('value') : Common.UI.Themes.THEME_LIGHT_ID);
},
applySettings: function() {

View file

@ -1010,8 +1010,8 @@ define([
editable : false,
cls : 'input-group-nr',
data : [
{ value: 'theme-light', displayValue: this.txtThemeLight },
{ value: 'theme-dark', displayValue: this.txtThemeDark }
{ value: Common.UI.Themes.THEME_LIGHT_ID, displayValue: this.txtThemeLight },
{ value: Common.UI.Themes.THEME_DARK_ID, displayValue: this.txtThemeDark }
]
});
@ -1176,7 +1176,7 @@ define([
this.chPaste.setValue(Common.Utils.InternalSettings.get("sse-settings-paste-button"));
item = this.cmbTheme.store.findWhere({value: Common.UI.Themes.current()});
this.cmbTheme.setValue(item ? item.get('value') : 0);
this.cmbTheme.setValue(item ? item.get('value') : Common.UI.Themes.THEME_LIGHT_ID);
},
applySettings: function() {