Merge pull request #1004 from ONLYOFFICE/feature/display-mode

Feature/display mode
This commit is contained in:
Julia Radzhabova 2021-07-22 15:03:15 +03:00 committed by GitHub
commit 5acdd2b8ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -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,

View file

@ -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;
},

View file

@ -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('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><%= caption %></div>' +
'<% if (options.description !== null) { %><label style="display: block;color: #a5a5a5;cursor: pointer;white-space: normal;"><%= options.description %></label>' +
'<% } %></a>');