Commit 80166697 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed problem with collecting an error messages in normal situation for undo.

parent 3e71dda0
...@@ -44,7 +44,8 @@ function CHistory(Document) ...@@ -44,7 +44,8 @@ function CHistory(Document)
this.Document = Document; this.Document = Document;
this.Api = null; this.Api = null;
this.CollaborativeEditing = null; this.CollaborativeEditing = null;
this.CanNotAddChanges = false;//флаг для отслеживания ошибок добавления изменений без точки:Create_NewPoint->Add->Save_Changes->Add this.CanNotAddChanges = false; // флаг для отслеживания ошибок добавления изменений без точки:Create_NewPoint->Add->Save_Changes->Add
this.CollectChanges = false;
this.RecalculateData = this.RecalculateData =
{ {
...@@ -318,6 +319,7 @@ CHistory.prototype = ...@@ -318,6 +319,7 @@ CHistory.prototype =
return; return;
this.CanNotAddChanges = false; this.CanNotAddChanges = false;
this.CollectChanges = false;
if (null !== this.SavedIndex && this.Index < this.SavedIndex) if (null !== this.SavedIndex && this.Index < this.SavedIndex)
this.Set_SavedIndex(this.Index); this.Set_SavedIndex(this.Index);
...@@ -359,10 +361,12 @@ CHistory.prototype = ...@@ -359,10 +361,12 @@ CHistory.prototype =
}; };
this.Points.length = this.Index + 1; this.Points.length = this.Index + 1;
this.CollectChanges = true;
}, },
Remove_LastPoint : function() Remove_LastPoint : function()
{ {
this.CollectChanges = false;
this.Index--; this.Index--;
this.Points.length = this.Index + 1; this.Points.length = this.Index + 1;
}, },
...@@ -1077,7 +1081,7 @@ CHistory.prototype = ...@@ -1077,7 +1081,7 @@ CHistory.prototype =
_CheckCanNotAddChanges : function() { _CheckCanNotAddChanges : function() {
try { try {
if (this.CanNotAddChanges && this.Api) { if (this.CanNotAddChanges && this.Api && !this.CollectChanges) {
var tmpErr = new Error(); var tmpErr = new Error();
if (tmpErr.stack) { if (tmpErr.stack) {
this.Api.CoAuthoringApi.sendChangesError(tmpErr.stack); this.Api.CoAuthoringApi.sendChangesError(tmpErr.stack);
......
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