diff --git a/apps/common/main/lib/controller/Themes.js b/apps/common/main/lib/controller/Themes.js index 3dfdcec9b..863594e41 100644 --- a/apps/common/main/lib/controller/Themes.js +++ b/apps/common/main/lib/controller/Themes.js @@ -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 () { diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 757772616..ddd30ccbf 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -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() { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index d11a5047d..05fc32092 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -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() { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 6223b070f..a78bb458c 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -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() {