diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 822326e02..d44335201 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -89,7 +89,7 @@ define([ this.collection = this.getApplication().getCollection('Common.Collections.ReviewChanges'); this.userCollection = this.getApplication().getCollection('Common.Collections.Users'); - this._state = {posx: -1000, posy: -1000, popoverVisible: false}; + this._state = {posx: -1000, posy: -1000, popoverVisible: false, previewMode: false}; Common.NotificationCenter.on('reviewchanges:turn', this.onTurnPreview.bind(this)); Common.NotificationCenter.on('spelling:turn', this.onTurnSpelling.bind(this)); @@ -511,9 +511,14 @@ define([ this.api.asc_EndViewModeInReview(); } this.disableEditing(item.value !== 'markup'); + this._state.previewMode = (item.value !== 'markup'); Common.NotificationCenter.trigger('edit:complete', this.view); }, + isPreviewChangesMode: function() { + return this._state.previewMode; + }, + disableEditing: function(disable) { var app = this.getApplication(); app.getController('RightMenu').getView('RightMenu').clearSelection(); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 1ad8c8de8..dcf87cd48 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -607,7 +607,8 @@ define([ action = this.stackLongActions.get({type: Asc.c_oAscAsyncActionType.BlockInteraction}); action ? this.setLongActionView(action) : this.loadMask && this.loadMask.hide(); - if ((id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2)) + if ((id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2 || + this.getApplication().getController('Common.Controllers.ReviewChanges').isPreviewChangesMode())) this.synchronizeChanges(); if ( type == Asc.c_oAscAsyncActionType.BlockInteraction &&