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

View file

@ -604,6 +604,22 @@ define([
me.applyLicense(); me.applyLicense();
$(document).on('contextmenu', _.bind(me.onContextMenu, me)); $(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(); Common.Gateway.documentReady();
}, },