From 134c5c907e3702e8e12a8ee51a329dd21441ebf9 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 9 Aug 2017 19:59:54 +0300 Subject: [PATCH] locked F1 hotkey for 'view' mode --- apps/documenteditor/main/app/controller/LeftMenu.js | 6 ++++-- apps/presentationeditor/main/app/controller/LeftMenu.js | 4 ++++ apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 8 +++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 75aad24f4..5b65bea3f 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -576,8 +576,10 @@ define([ } return false; case 'help': - Common.UI.Menu.Manager.hideAll(); - this.leftMenu.showMenu('file:help'); + if ( this.mode.isEdit ) { // TODO: unlock 'help' for 'view' mode + Common.UI.Menu.Manager.hideAll(); + this.leftMenu.showMenu('file:help'); + } return false; case 'file': Common.UI.Menu.Manager.hideAll(); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 589bfc2fc..b5d58c9c9 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -456,10 +456,14 @@ define([ } return false; case 'help': + if ( this.mode.isEdit ) { // TODO: unlock 'help' panel for 'view' mode + if (!previewPanel || !previewPanel.isVisible()){ Common.UI.Menu.Manager.hideAll(); this.leftMenu.showMenu('file:help'); } + + } return false; case 'file': if (!previewPanel || !previewPanel.isVisible()) { diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index a0f94ff6b..0b1b30e41 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -639,9 +639,11 @@ define([ } return false; case 'help': - Common.UI.Menu.Manager.hideAll(); - this.api.asc_closeCellEditor(); - this.leftMenu.showMenu('file:help'); + if ( this.mode.isEdit ) { // TODO: unlock 'help' panel for 'view' mode + Common.UI.Menu.Manager.hideAll(); + this.api.asc_closeCellEditor(); + this.leftMenu.showMenu('file:help'); + } return false; case 'file':