[mobile] Display review for view mode

This commit is contained in:
Julia Svinareva 2019-08-26 10:55:11 +03:00
parent 8a6af205d9
commit 09d3028f77
2 changed files with 31 additions and 7 deletions

View file

@ -60,6 +60,7 @@ define([
editUsers = [],
editor = !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE',
displayMode = "Markup",
canViewReview,
arrChangeReview = [],
dateChange = [],
_fileKey;
@ -208,11 +209,8 @@ define([
me.initComments();
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
} else {
if(editor === 'DE' && !this.appConfig.canReview) {
this.canViewReview = me.api.asc_HaveRevisionsChanges(true);
if (!this.canViewReview) {
$('#reviewing-settings').hide();
}
if(editor === 'DE' && !this.appConfig.canReview && !canViewReview) {
$('#reviewing-settings').hide();
}
}
},
@ -317,9 +315,14 @@ define([
},
initDisplayMode: function() {
var me = this;
var me = this,
value;
$('input:radio').single('change', _.bind(me.onReviewViewClick, me));
var value = displayMode;
if (me.appConfig.canReview) {
value = displayMode;
} else if (canViewReview) {
value = Common.localStorage.getItem("de-view-review-mode") || 'Original';
}
if (value == null || value === "Markup") {
$('input[value="Markup"]').attr('checked', true);
} else if (value === 'Final') {
@ -333,9 +336,14 @@ define([
return displayMode;
},
setCanViewReview: function(config) {
canViewReview = config;
},
onReviewViewClick: function(event) {
var value = $(event.currentTarget).val();
this.turnDisplayMode(value);
!this.appConfig.canReview && Common.localStorage.setItem("de-view-review-mode", value);
},
turnDisplayMode: function(value) {

View file

@ -604,6 +604,22 @@ define([
me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
if (!me.appOptions.canReview) {
var canViewReview = me.api.asc_HaveRevisionsChanges(true);
if (canViewReview) {
var viewReviewMode = Common.localStorage.getItem("de-view-review-mode");
viewReviewMode = viewReviewMode || 'Original';
if (viewReviewMode === 'Original')
me.api.asc_BeginViewModeInReview(false);
else if (viewReviewMode === 'Final')
me.api.asc_BeginViewModeInReview(true);
else
me.api.asc_EndViewModeInReview();
}
DE.getController('Common.Controllers.Collaboration').setCanViewReview(canViewReview);
}
Common.Gateway.documentReady();
},