diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 9251da230..bfeae3d1e 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -155,7 +155,8 @@ define([ var collection = this.getApplication().getCollection('Common.Collections.Comments'), resolved = Common.Utils.InternalSettings.get("de-settings-resolvedcomment"); for (var i = 0; i < collection.length; ++i) { - if (collection.at(i).get('userid') !== this.mode.user.id && (resolved || !collection.at(i).get('resolved'))) { + var comment = collection.at(i); + if (!comment.get('hide') && comment.get('userid') !== this.mode.user.id && (resolved || !comment.get('resolved'))) { this.leftMenu.markCoauthOptions('comments', true); break; } @@ -690,14 +691,14 @@ define([ onApiAddComment: function(id, data) { var resolved = Common.Utils.InternalSettings.get("de-settings-resolvedcomment"); - if (data && data.asc_getUserId() !== this.mode.user.id && (resolved || !data.asc_getSolved())) + if (data && data.asc_getUserId() !== this.mode.user.id && (resolved || !data.asc_getSolved()) && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) this.leftMenu.markCoauthOptions('comments'); }, onApiAddComments: function(data) { var resolved = Common.Utils.InternalSettings.get("de-settings-resolvedcomment"); for (var i = 0; i < data.length; ++i) { - if (data[i].asc_getUserId() !== this.mode.user.id && (resolved || !data[i].asc_getSolved())) { + if (data[i].asc_getUserId() !== this.mode.user.id && (resolved || !data[i].asc_getSolved()) && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) { this.leftMenu.markCoauthOptions('comments'); break; } diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 26565ba84..f74bda1b5 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -156,7 +156,8 @@ define([ this.api.asc_registerCallback('asc_onAddComments', _.bind(this.onApiAddComments, this)); var collection = this.getApplication().getCollection('Common.Collections.Comments'); for (var i = 0; i < collection.length; ++i) { - if (collection.at(i).get('userid') !== this.mode.user.id) { + var comment = collection.at(i); + if (!comment.get('hide') && comment.get('userid') !== this.mode.user.id) { this.leftMenu.markCoauthOptions('comments', true); break; } @@ -169,6 +170,7 @@ define([ this.leftMenu.getMenu('file').setApi(api); if (this.mode.canUseHistory) this.getApplication().getController('Common.Controllers.History').setApi(this.api).setMode(this.mode); + this.leftMenu.btnThumbs.toggle(true); return this; }, @@ -208,7 +210,6 @@ define([ (this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion); /** coauthoring end **/ Common.util.Shortcuts.resumeEvents(); - this.leftMenu.btnThumbs.toggle(true); return this; }, @@ -578,13 +579,13 @@ define([ }, onApiAddComment: function(id, data) { - if (data && data.asc_getUserId() !== this.mode.user.id) + if (data && data.asc_getUserId() !== this.mode.user.id && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) this.leftMenu.markCoauthOptions('comments'); }, onApiAddComments: function(data) { for (var i = 0; i < data.length; ++i) { - if (data[i].asc_getUserId() !== this.mode.user.id) { + if (data[i].asc_getUserId() !== this.mode.user.id && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) { this.leftMenu.markCoauthOptions('comments'); break; } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 97d05fbae..278e59cb1 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -803,7 +803,7 @@ define([ pluginsController = application.getController('Common.Controllers.Plugins'); leftmenuController.getView('LeftMenu').getMenu('file').loadDocument({doc:me.document}); - leftmenuController.setMode(me.appOptions).setApi(me.api).createDelayedElements(); + leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api); chatController.setApi(this.api).setMode(this.appOptions); application.getController('Common.Controllers.ExternalDiagramEditor').setApi(this.api).loadConfig({config:this.editorConfig, customization: this.editorConfig.customization}); diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 7e1ede550..5e00f02b2 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -682,7 +682,7 @@ define([ var comments = cellinfo.asc_getComments(); if (comments.length) { controller.onEditComments(comments); - } else if (this.permissions.canCoAuthoring || this.commentsCollection.getCommentsReplysCount()<3) { + } else if (this.permissions.canCoAuthoring) { controller.addDummyComment(); } } diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index e60895ed3..9d17ad6ab 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -157,7 +157,8 @@ define([ var collection = comments[name], resolved = Common.Utils.InternalSettings.get("sse-settings-resolvedcomment"); for (var i = 0; i < collection.length; ++i) { - if (collection.at(i).get('userid') !== this.mode.user.id && (resolved || !collection.at(i).get('resolved'))) { + var comment = collection.at(i); + if (!comment.get('hide') && comment.get('userid') !== this.mode.user.id && (resolved || !comment.get('resolved'))) { this.leftMenu.markCoauthOptions('comments', true); break; } @@ -718,14 +719,14 @@ define([ onApiAddComment: function(id, data) { var resolved = Common.Utils.InternalSettings.get("sse-settings-resolvedcomment"); - if (data && data.asc_getUserId() !== this.mode.user.id && (resolved || !data.asc_getSolved())) + if (data && data.asc_getUserId() !== this.mode.user.id && (resolved || !data.asc_getSolved()) && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) this.leftMenu.markCoauthOptions('comments'); }, onApiAddComments: function(data) { var resolved = Common.Utils.InternalSettings.get("sse-settings-resolvedcomment"); for (var i = 0; i < data.length; ++i) { - if (data[i].asc_getUserId() !== this.mode.user.id && (resolved || !data[i].asc_getSolved())) { + if (data[i].asc_getUserId() !== this.mode.user.id && (resolved || !data[i].asc_getSolved()) && AscCommon.UserInfoParser.canViewComment(data.asc_getUserName())) { this.leftMenu.markCoauthOptions('comments'); break; }