diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js
index 63d5296a4..f4b57afb3 100644
--- a/apps/common/mobile/lib/controller/Collaboration.js
+++ b/apps/common/mobile/lib/controller/Collaboration.js
@@ -59,7 +59,8 @@ define([
_userId,
editUsers = [],
editor = !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE',
- displayMode = "Markup",
+ 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();
}
}
},
@@ -276,7 +274,7 @@ define([
$('#settings-review input:checkbox').single('change', _.bind(me.onTrackChanges, me));
$('#settings-accept-all').single('click', _.bind(me.onAcceptAllClick, me));
$('#settings-reject-all').single('click', _.bind(me.onRejectAllClick, me));
- if(this.appConfig.isReviewOnly || displayMode == "Final" || displayMode == "Original" ) {
+ if(this.appConfig.isReviewOnly || displayMode == "final" || displayMode == "original" ) {
$('#settings-accept-all').addClass('disabled');
$('#settings-reject-all').addClass('disabled');
$('#settings-review').addClass('disabled');
@@ -320,12 +318,12 @@ define([
var me = this;
$('input:radio').single('change', _.bind(me.onReviewViewClick, me));
var value = displayMode;
- if (value == null || value === "Markup") {
- $('input[value="Markup"]').attr('checked', true);
- } else if (value === 'Final') {
- $('input[value="Final"]').attr('checked', true);
- } else if (value === 'Original') {
- $('input[value="Original"]').attr('checked', true);
+ if (value == null || value === "markup") {
+ $('input[value="markup"]').attr('checked', true);
+ } else if (value === 'final') {
+ $('input[value="final"]').attr('checked', true);
+ } else if (value === 'original') {
+ $('input[value="original"]').attr('checked', true);
}
},
@@ -333,24 +331,29 @@ 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) {
- displayMode = value;
+ turnDisplayMode: function(value, suppressEvent) {
+ displayMode = value.toLocaleLowerCase();
if (this.api) {
- if (value === 'Final')
+ if (displayMode === 'final')
this.api.asc_BeginViewModeInReview(true);
- else if (value === 'Original')
+ else if (displayMode === 'original')
this.api.asc_BeginViewModeInReview(false);
else
this.api.asc_EndViewModeInReview();
}
- this.initReviewingSettingsView();
- DE.getController('Toolbar').setDisplayMode(value);
+ !suppressEvent && this.initReviewingSettingsView();
+ DE.getController('Toolbar').setDisplayMode(displayMode);
},
@@ -386,7 +389,7 @@ define([
$('#btn-delete-change').single('click', _.bind(this.onDeleteChange, this));
}
}
- if(displayMode == "Final" || displayMode == "Original") {
+ if(displayMode == "final" || displayMode == "original") {
$('#btn-accept-change').addClass('disabled');
$('#btn-reject-change').addClass('disabled');
$('#btn-prev-change').addClass('disabled');
diff --git a/apps/common/mobile/lib/template/Collaboration.template b/apps/common/mobile/lib/template/Collaboration.template
index 39e076ded..ec41861a4 100644
--- a/apps/common/mobile/lib/template/Collaboration.template
+++ b/apps/common/mobile/lib/template/Collaboration.template
@@ -150,7 +150,7 @@
-