diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 16efe2f64..7c44ebaea 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -1484,6 +1484,11 @@ define([ this.updateComments(true); if (this.getPopover()) this.getPopover().update(true); + }, + + clearCollections: function() { + this.collection.reset(); + this.groupCollection = []; } }, Common.Controllers.Comments || {})); diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index 3d68ca4b4..2b77e07b8 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -152,7 +152,13 @@ define([ this.api.asc_showRevision(hist); var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) commentsController.onApiHideComment(); + if (commentsController) { + commentsController.onApiHideComment(); + commentsController.clearCollections(); + } + var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges'); + if (reviewController) + reviewController.onApiShowChange(); } }, @@ -202,7 +208,13 @@ define([ this.api.asc_showRevision(hist); var commentsController = this.getApplication().getController('Common.Controllers.Comments'); - if (commentsController) commentsController.onApiHideComment(); + if (commentsController) { + commentsController.onApiHideComment(); + commentsController.clearCollections(); + } + var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges'); + if (reviewController) + reviewController.onApiShowChange(); } } }, diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 07dd0f3f8..f1babf121 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -589,6 +589,9 @@ define([ /** coauthoring begin **/ this.leftMenu.btnComments.setDisabled(disable); + var comments = this.getApplication().getController('Common.Controllers.Comments'); + if (comments) + comments.setPreviewMode(disable); this.leftMenu.btnChat.setDisabled(disable); /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(disable); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 8adac22ab..1c41bdafd 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -588,12 +588,12 @@ define([ var app = this.getApplication(); if (this.appOptions.canEdit && this.editorConfig.mode !== 'view') { app.getController('RightMenu').getView('RightMenu').clearSelection(); - app.getController('Toolbar').DisableToolbar(disable, disable); app.getController('RightMenu').SetDisabled(disable, false); app.getController('Statusbar').getView('Statusbar').SetDisabled(disable); - app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable); } app.getController('LeftMenu').SetDisabled(disable, true); + app.getController('Toolbar').DisableToolbar(disable, disable); + app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable); }, goBack: function(current) { @@ -676,6 +676,10 @@ define([ this._state.fastCoauth) this.getApplication().getController('Common.Controllers.ReviewChanges').synchronizeChanges(); + if ( id == Asc.c_oAscAsyncAction['Open']) { + Common.Utils.InternalSettings.get("de-settings-livecomment") ? this.api.asc_showComments(Common.Utils.InternalSettings.get("de-settings-resolvedcomment")) : this.api.asc_hideComments(); + } + if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && (!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) && !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && (this.dontCloseDummyComment || this.dontCloseChat || this.isModalShowed || this.inFormControl)) ) {