From 2085aa6cdbd71efabf748ac13ffb7217dd1c6dba Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 9 Jan 2020 15:31:14 +0300 Subject: [PATCH] [SSE] Fix file menu when api is disconnected (#291) --- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index f9675c37b..874ce11e2 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -229,12 +229,17 @@ define([ setMode: function(mode) { this.mode = mode; - if (!this.mode.canPrint) - this.viewSettingsPicker.store.pop(); + if (!this.mode.canPrint) { + $(this.viewSettingsPicker.dataViewItems[1].el).hide(); + if (this.printSettings && this.printSettings.$el && this.printSettings.$el.hasClass('active')) + this.viewSettingsPicker.selectByIndex(0); + } this.generalSettings && this.generalSettings.setMode(this.mode); this.spellcheckSettings && this.spellcheckSettings.setMode(this.mode); if (!this.mode.isEdit) { $(this.viewSettingsPicker.dataViewItems[2].el).hide(); + if (this.spellcheckSettings && this.spellcheckSettings.$el && this.spellcheckSettings.$el.hasClass('active')) + this.viewSettingsPicker.selectByIndex(0); } },