From 630799d928f843fcba3a13234fcd691ba70fbc75 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 19 Jul 2021 13:42:03 +0300 Subject: [PATCH 1/2] [DE] Add parameter customization->review->hideReviewDisplay for hiding display mode button --- apps/api/documents/api.js | 3 +++ apps/common/main/lib/view/ReviewChanges.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index e6868323e..2aa7ad002 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -135,6 +135,9 @@ request: bool (default: true), // enable set name label: string (default: "Guest") // postfix for user name }, + review: { + hideReviewDisplay: false // hide button Review mode + }, chat: true, comments: true, zoom: 100, diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 6463da232..0b52de0d9 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -277,7 +277,7 @@ define([ caption: this.txtNext }); - if (!this.appConfig.isRestrictedEdit) {// hide Display mode option for fillForms and commenting mode + if (!this.appConfig.isRestrictedEdit && !(this.appConfig.customization && this.appConfig.customization.review && this.appConfig.customization.review.hideReviewDisplay)) {// hide Display mode option for fillForms and commenting mode var menuTemplate = _.template('
<%= caption %>
' + '<% if (options.description !== null) { %>' + '<% } %>
'); From 4177faa7eea1bb91127c00f99912e679fe15df29 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 19 Jul 2021 14:06:01 +0300 Subject: [PATCH 2/2] [DE] Support events for change review display mode --- apps/common/main/lib/controller/ReviewChanges.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 28b169af6..b9c7ac6b2 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -131,6 +131,8 @@ define([ this.api.asc_registerCallback('asc_onUpdateRevisionsChangesPosition', _.bind(this.onApiUpdateChangePosition, this)); this.api.asc_registerCallback('asc_onAuthParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); this.api.asc_registerCallback('asc_onParticipantsChanged', _.bind(this.onAuthParticipantsChanged, this)); + this.api.asc_registerCallback('asc_onBeginViewModeInReview', _.bind(this.onBeginViewModeInReview, this)); + this.api.asc_registerCallback('asc_onEndViewModeInReview', _.bind(this.onEndViewModeInReview, this)); } if (this.appConfig.canReview) this.api.asc_registerCallback('asc_onOnTrackRevisionsChange', _.bind(this.onApiTrackRevisionsChange, this)); @@ -694,6 +696,18 @@ define([ this._state.previewMode = (mode == 'final' || mode == 'original'); }, + onBeginViewModeInReview: function(mode) { + this.disableEditing(true); + this.view && this.view.turnDisplayMode(mode ? 'final' : 'original'); + this._state.previewMode = true; + }, + + onEndViewModeInReview: function() { + this.disableEditing(false); + this.view && this.view.turnDisplayMode('markup'); + this._state.previewMode = false; + }, + isPreviewChangesMode: function() { return this._state.previewMode; },