From b5ed433369329f1f6509e3da21eb9c930bfffbdd Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 19 Aug 2019 14:49:58 +0300 Subject: [PATCH] Fix menu File --- apps/documenteditor/main/app/view/FileMenu.js | 19 +++++++++---------- .../main/app/view/FileMenu.js | 18 ++++++++---------- .../main/app/view/FileMenu.js | 17 ++++++++--------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index ef6aa6879..bbf120cf3 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -250,21 +250,20 @@ define([ }, applyMode: function() { - this.miPrint[this.mode.canPrint?'show':'hide'](); - this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); - this.miProtect[this.mode.canProtect ?'show':'hide'](); - this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); - this.miRecent[this.mode.canOpenRecent?'show':'hide'](); - this.miNew[this.mode.canCreateNew?'show':'hide'](); - this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); - this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); -// this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); - this.miSave[this.mode.isEdit?'show':'hide'](); this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); + this.miPrint[this.mode.canPrint?'show':'hide'](); + this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); + this.miProtect[this.mode.canProtect ?'show':'hide'](); + var isVisible = this.mode.canDownload || this.mode.canDownloadOrigin || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect || + !this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp; + this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide'](); + this.miRecent[this.mode.canOpenRecent?'show':'hide'](); + this.miNew[this.mode.canCreateNew?'show':'hide'](); + this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); this.miAccess[(!this.mode.isOffline && !this.mode.isReviewOnly && this.document&&this.document.info && (this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 || diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 3a7fa0803..f76d34328 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -245,23 +245,21 @@ define([ }, applyMode: function() { + this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); + this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); + this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); + this.miSave[this.mode.isEdit?'show':'hide'](); + this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); this.miPrint[this.mode.canPrint?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miProtect[this.mode.canProtect ?'show':'hide'](); - this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); + var isVisible = this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect || + !this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp; + this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide'](); this.miRecent[this.mode.canOpenRecent?'show':'hide'](); this.miNew[this.mode.canCreateNew?'show':'hide'](); this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); - this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); - this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); - this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); - -// this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); - - this.miSave[this.mode.isEdit?'show':'hide'](); - this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); - this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 || this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide'](); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 722d725c1..1666b2ab4 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -234,22 +234,21 @@ define([ }, applyMode: function() { + this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); + this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); + this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); + this.miSave[this.mode.isEdit?'show':'hide'](); + this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); this.miPrint[this.mode.canPrint?'show':'hide'](); this.miRename[(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); this.miProtect[this.mode.canProtect ?'show':'hide'](); - this.miProtect.$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); + var isVisible = this.mode.canDownload || this.mode.isEdit || this.mode.canPrint || this.mode.canProtect || + !this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights || this.mode.canRename && !this.mode.isDesktopApp; + this.miProtect.$el.find('+.devider')[isVisible && !this.mode.isDisconnected?'show':'hide'](); this.miRecent[this.mode.canOpenRecent?'show':'hide'](); this.miNew[this.mode.canCreateNew?'show':'hide'](); this.miNew.$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); - this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); - this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); - this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); -// this.hkSaveAs[this.mode.canDownload?'enable':'disable'](); - - this.miSave[this.mode.isEdit?'show':'hide'](); - this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); - this.miAccess[(!this.mode.isOffline && this.document&&this.document.info&&(this.document.info.sharingSettings&&this.document.info.sharingSettings.length>0 || this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length))?'show':'hide']();