From 4ba266c6c7e8d3cbd4a7b41a146e6692d27c6dd5 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 24 Feb 2022 13:10:27 +0300 Subject: [PATCH] [all] fix bug 55359 --- apps/documenteditor/main/app/controller/ViewTab.js | 6 ++++-- apps/presentationeditor/main/app/controller/ViewTab.js | 6 ++++-- apps/spreadsheeteditor/main/app/controller/ViewTab.js | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/ViewTab.js b/apps/documenteditor/main/app/controller/ViewTab.js index 0e544b79b..6558e36aa 100644 --- a/apps/documenteditor/main/app/controller/ViewTab.js +++ b/apps/documenteditor/main/app/controller/ViewTab.js @@ -246,8 +246,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } this.view.btnDarkDocument.setDisabled(!Common.UI.Themes.isDarkTheme()); } }, diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 9fedc8a61..23d85f9f4 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -202,8 +202,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( !!menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 09d045e0b..8a09ef62b 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -284,8 +284,10 @@ define([ if (this.view) { var current_theme = Common.UI.Themes.currentThemeId() || Common.UI.Themes.defaultThemeId(), menu_item = _.findWhere(this.view.btnInterfaceTheme.menu.items, {value: current_theme}); - this.view.btnInterfaceTheme.menu.clearAll(); - menu_item.setChecked(true, true); + if ( !!menu_item ) { + this.view.btnInterfaceTheme.menu.clearAll(); + menu_item.setChecked(true, true); + } } }