[DE] Save/load display mode for review changes to/from local storage in viewer (set "original" mode by default)
This commit is contained in:
parent
61ce51f6a1
commit
db2f5818c7
|
@ -514,17 +514,22 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onReviewViewClick: function(menu, item, e) {
|
onReviewViewClick: function(menu, item, e) {
|
||||||
|
this.turnDisplayMode(item.value);
|
||||||
|
!this.appConfig.canReview && Common.localStorage.setItem(this.view.appPrefix + "review-mode", item.value);
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||||
|
},
|
||||||
|
|
||||||
|
turnDisplayMode: function(mode) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
if (item.value === 'final')
|
if (mode === 'final')
|
||||||
this.api.asc_BeginViewModeInReview(true);
|
this.api.asc_BeginViewModeInReview(true);
|
||||||
else if (item.value === 'original')
|
else if (mode === 'original')
|
||||||
this.api.asc_BeginViewModeInReview(false);
|
this.api.asc_BeginViewModeInReview(false);
|
||||||
else
|
else
|
||||||
this.api.asc_EndViewModeInReview();
|
this.api.asc_EndViewModeInReview();
|
||||||
}
|
}
|
||||||
this.disableEditing(item.value !== 'markup');
|
this.disableEditing(mode == 'final' || mode == 'original');
|
||||||
this._state.previewMode = (item.value !== 'markup');
|
this._state.previewMode = (mode == 'final' || mode == 'original');
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isPreviewChangesMode: function() {
|
isPreviewChangesMode: function() {
|
||||||
|
@ -628,8 +633,9 @@ define([
|
||||||
me.dlgChanges.show(Math.max(10, offset.left + sdk.width() - 300), Math.max(10, offset.top + sdk.height() - 150));
|
me.dlgChanges.show(Math.max(10, offset.left + sdk.width() - 300), Math.max(10, offset.top + sdk.height() - 150));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else if (config.canViewReview) {
|
||||||
config.canViewReview && (config.canViewReview = me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
|
config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users
|
||||||
|
config.canViewReview && me.turnDisplayMode(Common.localStorage.getItem(me.view.appPrefix + "review-mode") || 'original'); // load display mode only in viewer
|
||||||
}
|
}
|
||||||
|
|
||||||
if (me.view && me.view.btnChat) {
|
if (me.view && me.view.btnChat) {
|
||||||
|
|
|
@ -350,6 +350,7 @@ define([
|
||||||
]
|
]
|
||||||
}));
|
}));
|
||||||
me.btnReviewView.updateHint(me.tipReviewView);
|
me.btnReviewView.updateHint(me.tipReviewView);
|
||||||
|
!me.appConfig.canReview && me.turnDisplayMode(Common.localStorage.getItem(me.appPrefix + "review-mode") || 'original');
|
||||||
}
|
}
|
||||||
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
me.btnSharing && me.btnSharing.updateHint(me.tipSharing);
|
||||||
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
me.btnHistory && me.btnHistory.updateHint(me.tipHistory);
|
||||||
|
@ -530,6 +531,14 @@ define([
|
||||||
this.btnChat && this.btnChat.toggle(state, true);
|
this.btnChat && this.btnChat.toggle(state, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
turnDisplayMode: function(mode) {
|
||||||
|
if (this.btnReviewView) {
|
||||||
|
this.btnReviewView.menu.items[0].setChecked(mode=='markup', true);
|
||||||
|
this.btnReviewView.menu.items[1].setChecked(mode=='final', true);
|
||||||
|
this.btnReviewView.menu.items[2].setChecked(mode=='original', true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
SetDisabled: function (state, langs) {
|
SetDisabled: function (state, langs) {
|
||||||
this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
|
this.btnsSpelling && this.btnsSpelling.forEach(function(button) {
|
||||||
if ( button ) {
|
if ( button ) {
|
||||||
|
|
Loading…
Reference in a new issue