Fix Bug 51487
This commit is contained in:
parent
808dc86507
commit
f305e57396
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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});
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue