[DE mobile] Review refactoring
This commit is contained in:
parent
09d3028f77
commit
df6c0d9df8
|
@ -59,7 +59,7 @@ define([
|
|||
_userId,
|
||||
editUsers = [],
|
||||
editor = !!window.DE ? 'DE' : !!window.PE ? 'PE' : 'SSE',
|
||||
displayMode = "Markup",
|
||||
displayMode = "markup",
|
||||
canViewReview,
|
||||
arrChangeReview = [],
|
||||
dateChange = [],
|
||||
|
@ -274,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');
|
||||
|
@ -315,20 +315,15 @@ define([
|
|||
},
|
||||
|
||||
initDisplayMode: function() {
|
||||
var me = this,
|
||||
value;
|
||||
var me = this;
|
||||
$('input:radio').single('change', _.bind(me.onReviewViewClick, me));
|
||||
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') {
|
||||
$('input[value="Final"]').attr('checked', true);
|
||||
} else if (value === 'Original') {
|
||||
$('input[value="Original"]').attr('checked', true);
|
||||
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);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -346,19 +341,19 @@ define([
|
|||
!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);
|
||||
},
|
||||
|
||||
|
||||
|
@ -394,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');
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
<ul>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="doc-orientation" value="Markup">
|
||||
<input type="radio" name="doc-orientation" value="markup">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textMarkup %></div>
|
||||
|
@ -159,7 +159,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="doc-orientation" value="Final">
|
||||
<input type="radio" name="doc-orientation" value="final">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textFinal %></div>
|
||||
|
@ -168,7 +168,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label class="label-radio item-content">
|
||||
<input type="radio" name="doc-orientation" value="Original">
|
||||
<input type="radio" name="doc-orientation" value="original">
|
||||
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
|
||||
<div class="item-inner">
|
||||
<div class="item-title"><%= scope.textOriginal %></div>
|
||||
|
|
|
@ -606,18 +606,15 @@ define([
|
|||
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
|
||||
|
||||
if (!me.appOptions.canReview) {
|
||||
var canViewReview = me.api.asc_HaveRevisionsChanges(true);
|
||||
var canViewReview = me.appOptions.isEdit || me.api.asc_HaveRevisionsChanges(true);
|
||||
DE.getController('Common.Controllers.Collaboration').setCanViewReview(canViewReview);
|
||||
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();
|
||||
if (viewReviewMode===null)
|
||||
viewReviewMode = me.appOptions.customization && /^(original|final|markup)$/i.test(me.appOptions.customization.reviewDisplay) ? me.appOptions.customization.reviewDisplay.toLocaleLowerCase() : 'original';
|
||||
viewReviewMode = me.appOptions.isEdit ? 'markup' : viewReviewMode;
|
||||
DE.getController('Common.Controllers.Collaboration').turnDisplayMode(viewReviewMode);
|
||||
}
|
||||
DE.getController('Common.Controllers.Collaboration').setCanViewReview(canViewReview);
|
||||
}
|
||||
|
||||
Common.Gateway.documentReady();
|
||||
|
|
|
@ -262,7 +262,7 @@ define([
|
|||
$('#settings-print').single('click', _.bind(me.onPrint, me));
|
||||
$('#settings-collaboration').single('click', _.bind(me.clickCollaboration, me));
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") {
|
||||
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
|
||||
$('#settings-document').addClass('disabled');
|
||||
}
|
||||
var _userCount = DE.getController('Main').returnUserCount();
|
||||
|
@ -378,7 +378,7 @@ define([
|
|||
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
|
||||
$unitMeasurement.val([value]);
|
||||
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
|
||||
if(_stateDisplayMode == "Final" || _stateDisplayMode == "Original") {
|
||||
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
|
||||
$('#settings-no-characters').addClass('disabled');
|
||||
$('#settings-hidden-borders').addClass('disabled');
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ define([
|
|||
},
|
||||
|
||||
setDisplayMode: function(displayMode) {
|
||||
stateDisplayMode = displayMode == "Final" || displayMode == "Original" ? true : false;
|
||||
stateDisplayMode = displayMode == "final" || displayMode == "original" ? true : false;
|
||||
var selected = this.api.getSelectedElements();
|
||||
this.onApiFocusObject(selected);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue