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 ...@@ -1234,7 +1234,7 @@ CCellCommentator.prototype._addComment = function (oComment, bChange, bIsNotUpda
if (!bIsNotUpdate) if (!bIsNotUpdate)
this.drawCommentCells(); 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) { CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw) {
...@@ -1276,7 +1276,7 @@ CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw) ...@@ -1276,7 +1276,7 @@ CCellCommentator.prototype._removeComment = function (comment, bNoEvent, isDraw)
if (isDraw) if (isDraw)
this.drawCommentCells(); this.drawCommentCells();
if (!bNoEvent) if (!bNoEvent)
this.model.workbook.handlers.trigger("asc_onRemoveComment", id); this.model.workbook.handlers.trigger('removeComment', id);
}; };
CCellCommentator.prototype.isMissComments = function (range) { CCellCommentator.prototype.isMissComments = function (range) {
...@@ -1343,7 +1343,7 @@ CCellCommentator.prototype.Undo = function(type, data) { ...@@ -1343,7 +1343,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
for (i = 0; i < aComments.length; i++) { for (i = 0; i < aComments.length; i++) {
if (aComments[i].asc_getId() == data.asc_getId()) { if (aComments[i].asc_getId() == data.asc_getId()) {
aComments.splice(i, 1); aComments.splice(i, 1);
this.model.workbook.handlers.trigger("asc_onRemoveComment", data.asc_getId()); this.model.workbook.handlers.trigger('removeComment', data.asc_getId());
break; break;
} }
} }
...@@ -1356,7 +1356,7 @@ CCellCommentator.prototype.Undo = function(type, data) { ...@@ -1356,7 +1356,7 @@ CCellCommentator.prototype.Undo = function(type, data) {
parentComment.aReplies.push(data); parentComment.aReplies.push(data);
} else { } else {
aComments.push(data); 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; break;
...@@ -1395,7 +1395,7 @@ CCellCommentator.prototype.Redo = function(type, data) { ...@@ -1395,7 +1395,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
parentComment.aReplies.push(data); parentComment.aReplies.push(data);
} else { } else {
aComments.push(data); 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; break;
...@@ -1412,7 +1412,7 @@ CCellCommentator.prototype.Redo = function(type, data) { ...@@ -1412,7 +1412,7 @@ CCellCommentator.prototype.Redo = function(type, data) {
for (i = 0; i < aComments.length; i++) { for (i = 0; i < aComments.length; i++) {
if (aComments[i].asc_getId() == data.asc_getId()) { if (aComments[i].asc_getId() == data.asc_getId()) {
aComments.splice(i, 1); aComments.splice(i, 1);
this.model.workbook.handlers.trigger("asc_onRemoveComment", data.asc_getId()); this.model.workbook.handlers.trigger('removeComment', data.asc_getId());
break; break;
} }
} }
......
...@@ -789,6 +789,14 @@ ...@@ -789,6 +789,14 @@
this.handlers.add("asc_onLockDefNameManager", function(reason) { this.handlers.add("asc_onLockDefNameManager", function(reason) {
self.defNameAllowCreate = !(reason == Asc.c_oAscDefinedNameReason.LockDefNameManager); 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({ this.cellCommentator = new AscCommonExcel.CCellCommentator({
model: new WorkbookCommentsModel(this.handlers, this.model.aComments), 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