From fbb8c0c1100a861dd971a31e83c9358e90f5cd07 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 29 Oct 2019 17:08:47 +0300 Subject: [PATCH] Disable comments remove when comments are not displayed --- apps/common/main/lib/controller/ReviewChanges.js | 14 +++++++++++++- .../documenteditor/main/app/controller/LeftMenu.js | 1 + .../main/app/controller/LeftMenu.js | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 713d32d30..52901cea5 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -69,6 +69,10 @@ define([ 'FileMenu': { 'settings:apply': this.applySettings.bind(this) }, + 'LeftMenu': { + 'comments:show': _.bind(this.commentsShowHide, this, 'show'), + 'comments:hide': _.bind(this.commentsShowHide, this, 'hide') + }, 'Common.Views.ReviewChanges': { 'reviewchange:accept': _.bind(this.onAcceptClick, this), 'reviewchange:reject': _.bind(this.onRejectClick, this), @@ -695,7 +699,9 @@ define([ if (state !== me.view.btnChat.pressed) me.view.turnChat(state); }); - + } + if (me.view && me.view.btnCommentRemove) { + me.view.btnCommentRemove.setDisabled(!Common.localStorage.getBool(me.view.appPrefix + "settings-livecomment", true)); } }, @@ -774,6 +780,12 @@ define([ }); }, + commentsShowHide: function(mode) { + if (!this.view) return; + var value = Common.Utils.InternalSettings.get(this.view.appPrefix + "settings-livecomment"); + (value!==undefined) && this.view.btnCommentRemove && this.view.btnCommentRemove.setDisabled(mode != 'show' && !value); + }, + textInserted: 'Inserted:', textDeleted: 'Deleted:', textParaInserted: 'Paragraph Inserted ', diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index d8d17f7f6..6ebac79fd 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -467,6 +467,7 @@ define([ if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) value = resolved = true; (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); + this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide'); /** coauthoring end **/ value = Common.localStorage.getItem("de-settings-fontrender"); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 4b1221e53..c18f73f3c 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -367,6 +367,7 @@ define([ if (this.mode.canViewComments && this.leftMenu.panelComments.isVisible()) value = resolved = true; (value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments(); + this.getApplication().getController('Common.Controllers.ReviewChanges').commentsShowHide(value ? 'show' : 'hide'); value = Common.localStorage.getBool("sse-settings-r1c1"); Common.Utils.InternalSettings.set("sse-settings-r1c1", value);