Commit 40039102 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33374

send update cell info on add/remove comments
parent c4a75e52
......@@ -1234,7 +1234,7 @@ CCellCommentator.prototype._addComment = function (oComment, bChange, bIsNotUpda
if (!bIsNotUpdate)
this.drawCommentCells();
}
this.model.workbook.handlers.trigger("asc_onAddComment", oComment.asc_getId(), oComment);
this.model.workbook.handlers.trigger('addComment', oComment.asc_getId(), oComment);
};
CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw) {
......@@ -1276,7 +1276,7 @@ CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw)
if (isDraw)
this.drawCommentCells();
if (!bNoEvent)
this.model.workbook.handlers.trigger("asc_onRemoveComment", id);
this.model.workbook.handlers.trigger('removeComment', id);
};
CCellCommentator.prototype.isMissComments = function (range) {
......@@ -1343,7 +1343,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
for (i = 0; i < aComments.length; i++) {
if (aComments[i].asc_getId() == data.asc_getId()) {
aComments.splice(i, 1);
this.model.workbook.handlers.trigger("asc_onRemoveComment", data.asc_getId());
this.model.workbook.handlers.trigger('removeComment', data.asc_getId());
break;
}
}
......@@ -1356,7 +1356,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
parentComment.aReplies.push(data);
} else {
aComments.push(data);
this.model.workbook.handlers.trigger("asc_onAddComment", data.asc_getId(), data);
this.model.workbook.handlers.trigger('addComment', data.asc_getId(), data);
}
break;
......@@ -1395,7 +1395,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
parentComment.aReplies.push(data);
} else {
aComments.push(data);
this.model.workbook.handlers.trigger("asc_onAddComment", data.asc_getId(), data);
this.model.workbook.handlers.trigger('addComment', data.asc_getId(), data);
}
break;
......@@ -1412,7 +1412,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
for (i = 0; i < aComments.length; i++) {
if (aComments[i].asc_getId() == data.asc_getId()) {
aComments.splice(i, 1);
this.model.workbook.handlers.trigger("asc_onRemoveComment", data.asc_getId());
this.model.workbook.handlers.trigger('removeComment', data.asc_getId());
break;
}
}
......
......@@ -789,6 +789,14 @@
this.handlers.add("asc_onLockDefNameManager", function(reason) {
self.defNameAllowCreate = !(reason == Asc.c_oAscDefinedNameReason.LockDefNameManager);
});
this.handlers.add('addComment', function(id, data) {
self._onWSSelectionChanged();
self.handlers.trigger('asc_onAddComment', id, data);
});
this.handlers.add('removeComment', function(id) {
self._onWSSelectionChanged();
self.handlers.trigger('asc_onRemoveComment', id);
});
this.cellCommentator = new AscCommonExcel.CCellCommentator({
model: new WorkbookCommentsModel(this.handlers, this.model.aComments),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment